@@ -19,19 +19,18 @@ import * as ssm from '@aws-cdk/aws-ssm';
19
19
import * as ecs from '@aws-cdk/aws-ecs' ;
20
20
21
21
const allowedPattern = '.*' ;
22
- const description = 'The value Foo' ;
22
+ const description = 'The value Foo' ;
23
23
const parameterName = 'FooParameter' ;
24
24
const stringValue = 'Foo' ;
25
+ const clusterName = "custom-cluster-name" ;
26
+ const containerName = "custom-container-name" ;
27
+ const serviceName = "custom-service-name" ;
28
+ const familyName = "family-name" ;
29
+ const customName = 'custom-name' ;
25
30
26
31
test ( 'New service/new parameter store, public API, new VPC' , ( ) => {
27
32
const stack = new cdk . Stack ( ) ;
28
33
const publicApi = true ;
29
- const clusterName = "custom-cluster-name" ;
30
- const containerName = "custom-container-name" ;
31
- const serviceName = "custom-service-name" ;
32
- const parameterName = "custom-param-name" ;
33
- const stringValue = "Foo" ;
34
- const familyName = "family-name" ;
35
34
36
35
const construct = new FargateToSsmstringparameter ( stack , 'test-construct' , {
37
36
publicApi,
@@ -169,8 +168,6 @@ test('New service/new parameter store, public API, new VPC', () => {
169
168
test ( 'New service/new parameter store, private API, new VPC' , ( ) => {
170
169
const stack = new cdk . Stack ( ) ;
171
170
const publicApi = false ;
172
- const parameterName = 'param-name' ;
173
- const stringValue = 'Foo' ;
174
171
175
172
new FargateToSsmstringparameter ( stack , 'test-construct' , {
176
173
publicApi,
@@ -389,8 +386,8 @@ test('New service/existing parameter store, private API, existing VPC', () => {
389
386
} ) ;
390
387
391
388
expect ( stack ) . toHaveResourceLike ( "AWS::SSM::Parameter" , {
392
- Name : 'FooParameter' ,
393
- Value : "Foo"
389
+ Name : parameterName ,
390
+ Value : stringValue
394
391
} ) ;
395
392
expect ( stack ) . toHaveResourceLike ( "AWS::EC2::VPC" , {
396
393
CidrBlock : '172.168.0.0/16'
@@ -460,9 +457,6 @@ test('New service/existing parameter store, private API, existing VPC', () => {
460
457
test ( 'Existing service/new parameter store, public API, existing VPC' , ( ) => {
461
458
const stack = new cdk . Stack ( ) ;
462
459
const publicApi = true ;
463
- const serviceName = 'custom-name' ;
464
- const customName = 'CUSTOM_NAME' ;
465
- const parameterName = 'param-name' ;
466
460
467
461
const existingVpc = defaults . getTestVpc ( stack ) ;
468
462
@@ -484,7 +478,7 @@ test('Existing service/new parameter store, public API, existing VPC', () => {
484
478
stringParameterEnvironmentVariableName : customName ,
485
479
stringParameterProps : {
486
480
parameterName,
487
- stringValue : 'Foo'
481
+ stringValue
488
482
} ,
489
483
stringParameterPermissions : 'readwrite'
490
484
} ) ;
@@ -531,7 +525,7 @@ test('Existing service/new parameter store, public API, existing VPC', () => {
531
525
532
526
expect ( stack ) . toHaveResourceLike ( "AWS::SSM::Parameter" , {
533
527
Name : parameterName ,
534
- Value : "Foo"
528
+ Value : stringValue
535
529
} ) ;
536
530
537
531
expect ( stack ) . toHaveResourceLike ( "AWS::EC2::VPC" , {
@@ -630,7 +624,6 @@ test('Existing service/new parameter store, public API, existing VPC', () => {
630
624
test ( 'Existing service/existing parameter store, private API, existing VPC' , ( ) => {
631
625
const stack = new cdk . Stack ( ) ;
632
626
const publicApi = false ;
633
- const serviceName = 'custom-name' ;
634
627
635
628
const existingVpc = defaults . getTestVpc ( stack , publicApi ) ;
636
629
@@ -695,8 +688,8 @@ test('Existing service/existing parameter store, private API, existing VPC', ()
695
688
} ) ;
696
689
697
690
expect ( stack ) . toHaveResourceLike ( "AWS::SSM::Parameter" , {
698
- Name : "FooParameter" ,
699
- Value : "Foo"
691
+ Name : parameterName ,
692
+ Value : stringValue
700
693
} ) ;
701
694
expect ( stack ) . toHaveResourceLike ( "AWS::EC2::VPC" , {
702
695
CidrBlock : '172.168.0.0/16'
@@ -766,7 +759,6 @@ test('Existing service/existing parameter store, private API, existing VPC', ()
766
759
test ( 'Test error invalid string parameter permission' , ( ) => {
767
760
const stack = new cdk . Stack ( ) ;
768
761
const publicApi = false ;
769
- const serviceName = 'custom-name' ;
770
762
771
763
const existingVpc = defaults . getTestVpc ( stack , publicApi ) ;
772
764
@@ -799,7 +791,6 @@ test('Test error invalid string parameter permission', () => {
799
791
test ( 'Test error no existing object or prop provided' , ( ) => {
800
792
const stack = new cdk . Stack ( ) ;
801
793
const publicApi = false ;
802
- const serviceName = 'custom-name' ;
803
794
804
795
const existingVpc = defaults . getTestVpc ( stack , publicApi ) ;
805
796
0 commit comments