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 4f5dd98
Show file tree
Hide file tree
Showing 11 changed files with 32,202 additions and 209 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
Loading

0 comments on commit 4f5dd98

Please sign in to comment.