Skip to content

Commit a9e9c7f

Browse files
committed
fixed conflicting string name
1 parent f950945 commit a9e9c7f

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

source/patterns/@aws-solutions-constructs/aws-fargate-ssmstringparameter/test/fargate-ssmstringparameter.test.ts

+12-21
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,18 @@ import * as ssm from '@aws-cdk/aws-ssm';
1919
import * as ecs from '@aws-cdk/aws-ecs';
2020

2121
const allowedPattern = '.*';
22-
const description ='The value Foo';
22+
const description = 'The value Foo';
2323
const parameterName = 'FooParameter';
2424
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';
2530

2631
test('New service/new parameter store, public API, new VPC', () => {
2732
const stack = new cdk.Stack();
2833
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";
3534

3635
const construct = new FargateToSsmstringparameter(stack, 'test-construct', {
3736
publicApi,
@@ -169,8 +168,6 @@ test('New service/new parameter store, public API, new VPC', () => {
169168
test('New service/new parameter store, private API, new VPC', () => {
170169
const stack = new cdk.Stack();
171170
const publicApi = false;
172-
const parameterName = 'param-name';
173-
const stringValue = 'Foo';
174171

175172
new FargateToSsmstringparameter(stack, 'test-construct', {
176173
publicApi,
@@ -389,8 +386,8 @@ test('New service/existing parameter store, private API, existing VPC', () => {
389386
});
390387

391388
expect(stack).toHaveResourceLike("AWS::SSM::Parameter", {
392-
Name: 'FooParameter',
393-
Value: "Foo"
389+
Name: parameterName,
390+
Value: stringValue
394391
});
395392
expect(stack).toHaveResourceLike("AWS::EC2::VPC", {
396393
CidrBlock: '172.168.0.0/16'
@@ -460,9 +457,6 @@ test('New service/existing parameter store, private API, existing VPC', () => {
460457
test('Existing service/new parameter store, public API, existing VPC', () => {
461458
const stack = new cdk.Stack();
462459
const publicApi = true;
463-
const serviceName = 'custom-name';
464-
const customName = 'CUSTOM_NAME';
465-
const parameterName = 'param-name';
466460

467461
const existingVpc = defaults.getTestVpc(stack);
468462

@@ -484,7 +478,7 @@ test('Existing service/new parameter store, public API, existing VPC', () => {
484478
stringParameterEnvironmentVariableName: customName,
485479
stringParameterProps: {
486480
parameterName,
487-
stringValue: 'Foo'
481+
stringValue
488482
},
489483
stringParameterPermissions: 'readwrite'
490484
});
@@ -531,7 +525,7 @@ test('Existing service/new parameter store, public API, existing VPC', () => {
531525

532526
expect(stack).toHaveResourceLike("AWS::SSM::Parameter", {
533527
Name: parameterName,
534-
Value: "Foo"
528+
Value: stringValue
535529
});
536530

537531
expect(stack).toHaveResourceLike("AWS::EC2::VPC", {
@@ -630,7 +624,6 @@ test('Existing service/new parameter store, public API, existing VPC', () => {
630624
test('Existing service/existing parameter store, private API, existing VPC', () => {
631625
const stack = new cdk.Stack();
632626
const publicApi = false;
633-
const serviceName = 'custom-name';
634627

635628
const existingVpc = defaults.getTestVpc(stack, publicApi);
636629

@@ -695,8 +688,8 @@ test('Existing service/existing parameter store, private API, existing VPC', ()
695688
});
696689

697690
expect(stack).toHaveResourceLike("AWS::SSM::Parameter", {
698-
Name: "FooParameter",
699-
Value: "Foo"
691+
Name: parameterName,
692+
Value: stringValue
700693
});
701694
expect(stack).toHaveResourceLike("AWS::EC2::VPC", {
702695
CidrBlock: '172.168.0.0/16'
@@ -766,7 +759,6 @@ test('Existing service/existing parameter store, private API, existing VPC', ()
766759
test('Test error invalid string parameter permission', () => {
767760
const stack = new cdk.Stack();
768761
const publicApi = false;
769-
const serviceName = 'custom-name';
770762

771763
const existingVpc = defaults.getTestVpc(stack, publicApi);
772764

@@ -799,7 +791,6 @@ test('Test error invalid string parameter permission', () => {
799791
test('Test error no existing object or prop provided', () => {
800792
const stack = new cdk.Stack();
801793
const publicApi = false;
802-
const serviceName = 'custom-name';
803794

804795
const existingVpc = defaults.getTestVpc(stack, publicApi);
805796

0 commit comments

Comments
 (0)