Skip to content

Commit

Permalink
adding ipam scope type
Browse files Browse the repository at this point in the history
  • Loading branch information
shikha372 committed Aug 1, 2024
1 parent 429e6eb commit c9e0251
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions packages/@aws-cdk/aws-vpcv2-alpha/lib/ipam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,21 @@ export interface IpamProps{
readonly ipamName?: string;
}

/**
* Refers to two possible scope types under IPAM
*/
export enum IpamScopeType {
/**
* Default scopes created by IPAM
*/
DEFAULT = 'default',

/**
* Custom scope created using method
*/
CUSTOM = 'custom',
}

/**
* Options for configuring an IPAM pool.
*
Expand Down Expand Up @@ -258,6 +273,11 @@ export interface IIpamScopeBase{
*/
readonly props?: IpamScopeProps;

/**
* Defines scope type can be either default or custom
*/
readonly scopeType?: IpamScopeType;

/**
* Function to add a new pool to an IPAM scope
*/
Expand Down Expand Up @@ -357,12 +377,18 @@ class IpamScope extends Resource implements IIpamScopeBase {
*/
public readonly scope: Construct;

/**
* Defines scope type can be either default or custom
*/
public readonly scopeType: IpamScopeType;

constructor(scope: Construct, id: string, props: IpamScopeProps) {
super(scope, id);
this._ipamScope = new CfnIPAMScope(scope, 'IpamScope', {
ipamId: props.ipamId,
});
this.scopeId = this._ipamScope.attrIpamScopeId;
this.scopeType = IpamScopeType.CUSTOM;
this.scope = scope;
this.props = props;
}
Expand All @@ -385,7 +411,10 @@ class IpamScopeBase implements IIpamScopeBase {
readonly scope: Construct,
readonly scopeId: string,
readonly props: IpamScopeProps,
) {}
readonly scopeType?: IpamScopeType,
) {
this.scopeType = IpamScopeType.DEFAULT;
}

/**
* Adds a pool to the IPAM scope.
Expand Down Expand Up @@ -430,7 +459,7 @@ export class Ipam extends Resource {
public readonly operatingRegions: string[];

/**
* List of custom scopes created under this IPAM
* List of scopes created under this IPAM
*/
public readonly scopes: IIpamScopeBase[] = [];

Expand Down

0 comments on commit c9e0251

Please sign in to comment.