Skip to content

Commit f902cc7

Browse files
authored
Issue 210 (#212)
1 parent 48d6c3e commit f902cc7

File tree

10 files changed

+140
-136
lines changed

10 files changed

+140
-136
lines changed

Diff for: source/patterns/@aws-solutions-constructs/aws-lambda-sagemakerendpoint/test/__snapshots__/aws-lambda-sagemakerendpoint.test.js.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ Object {
568568
},
569569
},
570570
"Resources": Object {
571-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF": Object {
571+
"DefaultSAGEMAKERRUNTIMEsecuritygroup32609E8C": Object {
572572
"Metadata": Object {
573573
"cfn_nag": Object {
574574
"rules_to_suppress": Array [
@@ -584,7 +584,7 @@ Object {
584584
},
585585
},
586586
"Properties": Object {
587-
"GroupDescription": "Default/ReplaceEndpointDefaultSecurityGroup-security-group",
587+
"GroupDescription": "Default/Default-SAGEMAKER_RUNTIME-security-group",
588588
"SecurityGroupEgress": Array [
589589
Object {
590590
"CidrIp": "0.0.0.0/0",
@@ -783,7 +783,7 @@ Object {
783783
"SecurityGroupIds": Array [
784784
Object {
785785
"Fn::GetAtt": Array [
786-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF",
786+
"DefaultSAGEMAKERRUNTIMEsecuritygroup32609E8C",
787787
"GroupId",
788788
],
789789
},

Diff for: source/patterns/@aws-solutions-constructs/aws-lambda-secretsmanager/test/integ.deployFunctionWithExistingVpc.expected.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@
674674
"SecurityGroupIds": [
675675
{
676676
"Fn::GetAtt": [
677-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF",
677+
"deployFunctionWithExistingVpcSECRETSMANAGERsecuritygroupB20BA3EB",
678678
"GroupId"
679679
]
680680
}
@@ -956,10 +956,10 @@
956956
}
957957
}
958958
},
959-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF": {
959+
"deployFunctionWithExistingVpcSECRETSMANAGERsecuritygroupB20BA3EB": {
960960
"Type": "AWS::EC2::SecurityGroup",
961961
"Properties": {
962-
"GroupDescription": "deployFunctionWithExistingVpc/ReplaceEndpointDefaultSecurityGroup-security-group",
962+
"GroupDescription": "deployFunctionWithExistingVpc/deployFunctionWithExistingVpc-SECRETS_MANAGER-security-group",
963963
"SecurityGroupEgress": [
964964
{
965965
"CidrIp": "0.0.0.0/0",

Diff for: source/patterns/@aws-solutions-constructs/aws-lambda-secretsmanager/test/integ.deployFunctionWithVpc.expected.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@
558558
"SecurityGroupIds": [
559559
{
560560
"Fn::GetAtt": [
561-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF",
561+
"deployFunctionWithVpcSECRETSMANAGERsecuritygroup140A8C59",
562562
"GroupId"
563563
]
564564
}
@@ -577,10 +577,10 @@
577577
"VpcEndpointType": "Interface"
578578
}
579579
},
580-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF": {
580+
"deployFunctionWithVpcSECRETSMANAGERsecuritygroup140A8C59": {
581581
"Type": "AWS::EC2::SecurityGroup",
582582
"Properties": {
583-
"GroupDescription": "deployFunctionWithVpc/ReplaceEndpointDefaultSecurityGroup-security-group",
583+
"GroupDescription": "deployFunctionWithVpc/deployFunctionWithVpc-SECRETS_MANAGER-security-group",
584584
"SecurityGroupEgress": [
585585
{
586586
"CidrIp": "0.0.0.0/0",

Diff for: source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/integ.deployFunctionWithVpc.expected.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@
650650
"SecurityGroupIds": [
651651
{
652652
"Fn::GetAtt": [
653-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF",
653+
"deployFunctionWithVpcSNSsecuritygroup5E54C413",
654654
"GroupId"
655655
]
656656
}
@@ -669,10 +669,10 @@
669669
"VpcEndpointType": "Interface"
670670
}
671671
},
672-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF": {
672+
"deployFunctionWithVpcSNSsecuritygroup5E54C413": {
673673
"Type": "AWS::EC2::SecurityGroup",
674674
"Properties": {
675-
"GroupDescription": "deployFunctionWithVpc/ReplaceEndpointDefaultSecurityGroup-security-group",
675+
"GroupDescription": "deployFunctionWithVpc/deployFunctionWithVpc-SNS-security-group",
676676
"SecurityGroupEgress": [
677677
{
678678
"CidrIp": "0.0.0.0/0",

Diff for: source/patterns/@aws-solutions-constructs/aws-lambda-sqs/test/integ.deployFunctionWithVpc.expected.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@
707707
"SecurityGroupIds": [
708708
{
709709
"Fn::GetAtt": [
710-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF",
710+
"deployFunctionWithVpcSQSsecuritygroup2E4E2685",
711711
"GroupId"
712712
]
713713
}
@@ -726,10 +726,10 @@
726726
"VpcEndpointType": "Interface"
727727
}
728728
},
729-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF": {
729+
"deployFunctionWithVpcSQSsecuritygroup2E4E2685": {
730730
"Type": "AWS::EC2::SecurityGroup",
731731
"Properties": {
732-
"GroupDescription": "deployFunctionWithVpc/ReplaceEndpointDefaultSecurityGroup-security-group",
732+
"GroupDescription": "deployFunctionWithVpc/deployFunctionWithVpc-SQS-security-group",
733733
"SecurityGroupEgress": [
734734
{
735735
"CidrIp": "0.0.0.0/0",

Diff for: source/patterns/@aws-solutions-constructs/aws-lambda-ssmstringparameter/test/integ.deployFunctionWithExistingVpc.expected.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@
674674
"SecurityGroupIds": [
675675
{
676676
"Fn::GetAtt": [
677-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF",
677+
"deployFunctionWithExistingVpcSSMsecuritygroupC287F479",
678678
"GroupId"
679679
]
680680
}
@@ -967,10 +967,10 @@
967967
"Value": "test-string-value"
968968
}
969969
},
970-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF": {
970+
"deployFunctionWithExistingVpcSSMsecuritygroupC287F479": {
971971
"Type": "AWS::EC2::SecurityGroup",
972972
"Properties": {
973-
"GroupDescription": "deployFunctionWithExistingVpc/ReplaceEndpointDefaultSecurityGroup-security-group",
973+
"GroupDescription": "deployFunctionWithExistingVpc/deployFunctionWithExistingVpc-SSM-security-group",
974974
"SecurityGroupEgress": [
975975
{
976976
"CidrIp": "0.0.0.0/0",

Diff for: source/patterns/@aws-solutions-constructs/aws-lambda-ssmstringparameter/test/integ.deployFunctionWithVpc.expected.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@
569569
"SecurityGroupIds": [
570570
{
571571
"Fn::GetAtt": [
572-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF",
572+
"deployFunctionWithVpcSSMsecuritygroup918CB15C",
573573
"GroupId"
574574
]
575575
}
@@ -588,10 +588,10 @@
588588
"VpcEndpointType": "Interface"
589589
}
590590
},
591-
"ReplaceEndpointDefaultSecurityGroupsecuritygroupB97DD1AF": {
591+
"deployFunctionWithVpcSSMsecuritygroup918CB15C": {
592592
"Type": "AWS::EC2::SecurityGroup",
593593
"Properties": {
594-
"GroupDescription": "deployFunctionWithVpc/ReplaceEndpointDefaultSecurityGroup-security-group",
594+
"GroupDescription": "deployFunctionWithVpc/deployFunctionWithVpc-SSM-security-group",
595595
"SecurityGroupEgress": [
596596
{
597597
"CidrIp": "0.0.0.0/0",

Diff for: source/patterns/@aws-solutions-constructs/core/lib/vpc-helper.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ export function buildVpc(scope: Construct, props: BuildVpcProps): ec2.IVpc {
4949
}
5050

5151
if (props?.constructVpcProps) {
52-
cumulativeProps = overrideProps(
53-
cumulativeProps,
54-
props?.constructVpcProps
55-
);
52+
cumulativeProps = overrideProps(cumulativeProps, props?.constructVpcProps);
5653
}
5754

5855
const vpc = new ec2.Vpc(scope, "Vpc", cumulativeProps);
@@ -172,7 +169,7 @@ export function AddAwsServiceEndpoint(
172169

173170
const endpointDefaultSecurityGroup = buildSecurityGroup(
174171
scope,
175-
"ReplaceEndpointDefaultSecurityGroup",
172+
`${scope.node.id}-${service.endpointName}`,
176173
{
177174
vpc,
178175
allowAllOutbound: true,

0 commit comments

Comments
 (0)