Skip to content

Commit

Permalink
adding assertions for integ test
Browse files Browse the repository at this point in the history
  • Loading branch information
shikha372 committed Dec 3, 2024
1 parent 74d925d commit b540262
Show file tree
Hide file tree
Showing 53 changed files with 32,677 additions and 404 deletions.
21 changes: 9 additions & 12 deletions packages/@aws-cdk/aws-ec2-alpha/lib/ipam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,16 @@ export interface PoolOptions {
* @default - required in case of an IPv6, throws an error if not provided.
*/
readonly awsService?: AwsServiceName;

/**
* IPAM Pool resource name to be used for tagging
*
* @default - autogenerated by CDK if not provided
*/
readonly ipamPoolName?: string;
}

const NAME_TAG: string = 'NAME';
//const IPAM_TAG: string = 'IPAM';
const NAME_TAG: string = 'Name';

/**
* Properties for creating an IPAM pool.
Expand All @@ -150,13 +156,6 @@ interface IpamPoolProps extends PoolOptions {
* Scope id where pool needs to be created
*/
readonly ipamScopeId: string;

/**
* IPAM resource name
*
* @default - autogenerated by CDK if not provided
*/
readonly ipamPoolName?: string;
}

/**
Expand Down Expand Up @@ -449,7 +448,6 @@ class IpamScopeBase implements IIpamScopeBase {
readonly scopeType?: IpamScopeType,
) {
this.scopeType = IpamScopeType.DEFAULT;
//Tags.of(this).add(NAME_TAG, 'DefaultIpamScope');
if (!props.ipamScopeId) {
throw new Error('ipamScopeId is required');
} else {
Expand Down Expand Up @@ -551,7 +549,6 @@ export class Ipam extends Resource {
public addScope(scope: Construct, id: string, options: IpamScopeOptions): IIpamScopeBase {
const ipamScope = new IpamScope(scope, id, {
...options,
ipamScopeName: options.ipamScopeName,
ipamId: this.ipamId,
ipamOperatingRegions: this.operatingRegions,
});
Expand Down Expand Up @@ -581,7 +578,7 @@ function createIpamPool(
}

return new IpamPool(scope, id, {
ipamPoolName: id,
ipamPoolName: poolOptions.ipamPoolName,
addressFamily: poolOptions.addressFamily,
ipv4ProvisionedCidrs: poolOptions.ipv4ProvisionedCidrs,
ipamScopeId: scopeId,
Expand Down
12 changes: 10 additions & 2 deletions packages/@aws-cdk/aws-ec2-alpha/lib/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,22 @@ export class VPNGatewayV2 extends Resource implements IRouteTarget {
* @resource AWS::EC2::NatGateway
*/
export class NatGateway extends Resource implements IRouteTarget {

/**
* Id of the NatGateway
* @attribute
*/
public readonly natGatewayId: string;

/**
* The type of router used in the route.
*/
readonly routerType: RouterType;
public readonly routerType: RouterType;

/**
* The ID of the route target.
*/
readonly routerTargetId: string;
public readonly routerTargetId: string;

/**
* Indicates whether the NAT gateway supports public or private connectivity.
Expand Down Expand Up @@ -451,6 +458,7 @@ export class NatGateway extends Resource implements IRouteTarget {
secondaryAllocationIds: props.secondaryAllocationIds,
...props,
});
this.natGatewayId = this.resource.attrNatGatewayId;

this.routerTargetId = this.resource.attrNatGatewayId;
this.node.defaultChild = this.resource;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@
"CidrBlock": "10.0.0.0/16",
"EnableDnsHostnames": true,
"EnableDnsSupport": true,
"InstanceTenancy": "default"
"InstanceTenancy": "default",
"Tags": [
{
"Key": "Name",
"Value": "aws-cdk-vpcv2-alpha-integ-ipam/VPC-integ-test-1"
}
]
}
},
"VPCintegtest1ipv4IpamCidr451A5376": {
Expand Down Expand Up @@ -124,6 +130,12 @@
"testsbubnetRouteTableD0136BEA": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"Tags": [
{
"Key": "Name",
"Value": "DefaultCDKRouteTable"
}
],
"VpcId": {
"Fn::GetAtt": [
"VPCintegtest1EBA1CB75",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
"CidrBlock": "10.0.0.0/16",
"EnableDnsHostnames": true,
"EnableDnsSupport": true,
"InstanceTenancy": "default"
"InstanceTenancy": "default",
"Tags": [
{
"Key": "Name",
"Value": "acceptor-stack/acceptorVpc"
}
]
}
},
"acceptorVpcVpcPeeringRoleF389E47A": {
Expand All @@ -25,7 +31,13 @@
"Version": "2012-10-17"
},
"Description": "Restrictive role for VPC peering",
"RoleName": "VpcPeeringRole"
"RoleName": "VpcPeeringRole",
"Tags": [
{
"Key": "Name",
"Value": "acceptor-stack/acceptorVpc"
}
]
}
},
"acceptorVpcVpcPeeringRoleDefaultPolicyE79C72D0": {
Expand Down Expand Up @@ -110,7 +122,13 @@
"CidrBlock": "10.1.0.0/16",
"EnableDnsHostnames": true,
"EnableDnsSupport": true,
"InstanceTenancy": "default"
"InstanceTenancy": "default",
"Tags": [
{
"Key": "Name",
"Value": "acceptor-stack/requestorVpcSameAccount"
}
]
}
},
"requestorVpcSameAccountsameAccountPeeringVPCPeeringConnection4E07C8CD": {
Expand All @@ -124,6 +142,12 @@
"VpcId"
]
},
"Tags": [
{
"Key": "Name",
"Value": "acceptor-stack/requestorVpcSameAccount"
}
],
"VpcId": {
"Fn::GetAtt": [
"requestorVpcSameAccountF27E91F7",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
"CidrBlock": "10.2.0.0/16",
"EnableDnsHostnames": true,
"EnableDnsSupport": true,
"InstanceTenancy": "default"
"InstanceTenancy": "default",
"Tags": [
{
"Key": "Name",
"Value": "requestor-stack/requestorVpcCrossAccount"
}
]
}
},
"requestorVpcCrossAccountacceptorAccountCrossRegionPeeringVPCPeeringConnection3605B6B0": {
Expand All @@ -16,6 +22,12 @@
"PeerRegion": "us-east-1",
"PeerRoleArn": "arn:aws:iam::916743627080:role/VpcPeeringRole",
"PeerVpcId": "vpc-09b9235d8a3195ba3",
"Tags": [
{
"Key": "Name",
"Value": "requestor-stack/requestorVpcCrossAccount"
}
],
"VpcId": {
"Fn::GetAtt": [
"requestorVpcCrossAccount6372A252",
Expand Down
Loading

0 comments on commit b540262

Please sign in to comment.