Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed EIP retreival from plugin subnet on existing VPC #123

Merged
merged 4 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions iac/roots/opa-common-constructs/src/network-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,27 @@ export class NetworkConstruct extends Construct {
vpcId: props.existingVpcId,
});

// Retrieve the subnet IDs

// Retrieve the subnet IDs
// Retrieve the subnet IDs
const publicsubnetIds = vpc.publicSubnets.length > 0
? vpc.publicSubnets.map(subnet => subnet.subnetId)
: [' '];
const privateSubnetIds = vpc.privateSubnets.length > 0
? vpc.privateSubnets.map(subnet => subnet.subnetId)
: [' '];

// Retrieve Elastic IPs allocated to the existing public subnet
this.publicEIPref = [];
vpc.publicSubnets
.map((subnet) =>
(subnet as ec2.PublicSubnet).node.children
.filter((child) => child.node.id == "EIP")
.map((child) => child as ec2.CfnEIP),
)
.flat()
.forEach((eip) => {
this.publicEIPref.push(eip.ref);
});

// Store the public subnet IDs in AWS Systems Manager Parameter Store
new ssm.StringListParameter(this, `${envIdentifier}-pub-subnet-param`, {
allowedPattern: ".*",
Expand Down
2 changes: 1 addition & 1 deletion iac/roots/opa-platform/src/opa-platform-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class OPAPlatformStack extends cdk.Stack {
{
id: "AwsSolutions-SMG4",
reason:
"Rotation is not nessacry .",
"Rotation is not necessary.",
fjudith marked this conversation as resolved.
Show resolved Hide resolved
},
]);
}
Expand Down
Loading