io.github.cdklabs.cdk.cicd.wrapper.VPCFromLookUpStack Maven / Gradle / Ivy
Show all versions of cdk-cicd-wrapper Show documentation
package io.github.cdklabs.cdk.cicd.wrapper;
/**
* A stack that creates or looks up a VPC and configures its settings.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-03T16:35:59.362Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.cicd.wrapper.$Module.class, fqn = "@cdklabs/cdk-cicd-wrapper.VPCFromLookUpStack")
public class VPCFromLookUpStack extends software.amazon.awscdk.Stack {
protected VPCFromLookUpStack(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected VPCFromLookUpStack(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public VPCFromLookUpStack(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.cicd.wrapper.VPCFromLookUpStackProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* The list of CodeBuild VPC InterfacesVpcEndpointAwsServices.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.util.List getCodeBuildVPCInterfaces() {
return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.get(this, "codeBuildVPCInterfaces", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.InterfaceVpcEndpointAwsService.class))));
}
/**
* The VPC created or looked up by this stack.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.IVpc getVpc() {
return software.amazon.jsii.Kernel.get(this, "vpc", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.IVpc.class));
}
/**
* The ID of the VPC being created or looked up.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getVpcId() {
return software.amazon.jsii.Kernel.get(this, "vpcId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* The security group attached to the VPC.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.ISecurityGroup getSecurityGroup() {
return software.amazon.jsii.Kernel.get(this, "securityGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.ISecurityGroup.class));
}
/**
* The subnets attached to the VPC.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.SubnetType getSubnetType() {
return software.amazon.jsii.Kernel.get(this, "subnetType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.SubnetType.class));
}
/**
* A fluent builder for {@link io.github.cdklabs.cdk.cicd.wrapper.VPCFromLookUpStack}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final io.github.cdklabs.cdk.cicd.wrapper.VPCFromLookUpStackProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new io.github.cdklabs.cdk.cicd.wrapper.VPCFromLookUpStackProps.Builder();
}
/**
* Include runtime versioning information in this Stack.
*
* Default: `analyticsReporting` setting of containing `App`, or value of
* 'aws:cdk:version-reporting' context key
*
* @return {@code this}
* @param analyticsReporting Include runtime versioning information in this Stack. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder analyticsReporting(final java.lang.Boolean analyticsReporting) {
this.props.analyticsReporting(analyticsReporting);
return this;
}
/**
* Enable this flag to allow native cross region stack references.
*
* Enabling this will create a CloudFormation custom resource
* in both the producing stack and consuming stack in order to perform the export/import
*
* This feature is currently experimental
*
* Default: false
*
* @return {@code this}
* @param crossRegionReferences Enable this flag to allow native cross region stack references. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder crossRegionReferences(final java.lang.Boolean crossRegionReferences) {
this.props.crossRegionReferences(crossRegionReferences);
return this;
}
/**
* A description of the stack.
*
* Default: - No description.
*
* @return {@code this}
* @param description A description of the stack. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder description(final java.lang.String description) {
this.props.description(description);
return this;
}
/**
* The AWS environment (account/region) where this stack will be deployed.
*
* Set the region
/account
fields of env
to either a concrete value to
* select the indicated environment (recommended for production stacks), or to
* the values of environment variables
* CDK_DEFAULT_REGION
/CDK_DEFAULT_ACCOUNT
to let the target environment
* depend on the AWS credentials/configuration that the CDK CLI is executed
* under (recommended for development stacks).
*
* If the Stack
is instantiated inside a Stage
, any undefined
* region
/account
fields from env
will default to the same field on the
* encompassing Stage
, if configured there.
*
* If either region
or account
are not set nor inherited from Stage
, the
* Stack will be considered "environment-agnostic"". Environment-agnostic
* stacks can be deployed to any environment but may not be able to take
* advantage of all features of the CDK. For example, they will not be able to
* use environmental context lookups such as ec2.Vpc.fromLookup
and will not
* automatically translate Service Principals to the right format based on the
* environment's AWS partition, and other such enhancements.
*
* Default: - The environment of the containing `Stage` if available,
* otherwise create the stack will be environment-agnostic.
*
* Example:
*
*
* // Use a concrete account and region to deploy this stack to:
* // `.account` and `.region` will simply return these values.
* new Stack(app, 'Stack1', {
* env: {
* account: '123456789012',
* region: 'us-east-1'
* },
* });
* // Use the CLI's current credentials to determine the target environment:
* // `.account` and `.region` will reflect the account+region the CLI
* // is configured to use (based on the user CLI credentials)
* new Stack(app, 'Stack2', {
* env: {
* account: process.env.CDK_DEFAULT_ACCOUNT,
* region: process.env.CDK_DEFAULT_REGION
* },
* });
* // Define multiple stacks stage associated with an environment
* const myStage = new Stage(app, 'MyStage', {
* env: {
* account: '123456789012',
* region: 'us-east-1'
* }
* });
* // both of these stacks will use the stage's account/region:
* // `.account` and `.region` will resolve to the concrete values as above
* new MyStack(myStage, 'Stack1');
* new YourStack(myStage, 'Stack2');
* // Define an environment-agnostic stack:
* // `.account` and `.region` will resolve to `{ "Ref": "AWS::AccountId" }` and `{ "Ref": "AWS::Region" }` respectively.
* // which will only resolve to actual values by CloudFormation during deployment.
* new MyStack(app, 'Stack1');
*
*
* @return {@code this}
* @param env The AWS environment (account/region) where this stack will be deployed. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder env(final software.amazon.awscdk.Environment env) {
this.props.env(env);
return this;
}
/**
* Options for applying a permissions boundary to all IAM Roles and Users created within this Stage.
*
* Default: - no permissions boundary is applied
*
* @return {@code this}
* @param permissionsBoundary Options for applying a permissions boundary to all IAM Roles and Users created within this Stage. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder permissionsBoundary(final software.amazon.awscdk.PermissionsBoundary permissionsBoundary) {
this.props.permissionsBoundary(permissionsBoundary);
return this;
}
/**
* Name to deploy the stack with.
*
* Default: - Derived from construct path.
*
* @return {@code this}
* @param stackName Name to deploy the stack with. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder stackName(final java.lang.String stackName) {
this.props.stackName(stackName);
return this;
}
/**
* Enable this flag to suppress indentation in generated CloudFormation templates.
*
* If not specified, the value of the @aws-cdk/core:suppressTemplateIndentation
* context key will be used. If that is not specified, then the
* default value false
will be used.
*
* Default: - the value of `@aws-cdk/core:suppressTemplateIndentation`, or `false` if that is not set.
*
* @return {@code this}
* @param suppressTemplateIndentation Enable this flag to suppress indentation in generated CloudFormation templates. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder suppressTemplateIndentation(final java.lang.Boolean suppressTemplateIndentation) {
this.props.suppressTemplateIndentation(suppressTemplateIndentation);
return this;
}
/**
* Synthesis method to use while deploying this stack.
*
* The Stack Synthesizer controls aspects of synthesis and deployment,
* like how assets are referenced and what IAM roles to use. For more
* information, see the README of the main CDK package.
*
* If not specified, the defaultStackSynthesizer
from App
will be used.
* If that is not specified, DefaultStackSynthesizer
is used if
* @aws-cdk/core:newStyleStackSynthesis
is set to true
or the CDK major
* version is v2. In CDK v1 LegacyStackSynthesizer
is the default if no
* other synthesizer is specified.
*
* Default: - The synthesizer specified on `App`, or `DefaultStackSynthesizer` otherwise.
*
* @return {@code this}
* @param synthesizer Synthesis method to use while deploying this stack. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder synthesizer(final software.amazon.awscdk.IStackSynthesizer synthesizer) {
this.props.synthesizer(synthesizer);
return this;
}
/**
* Stack tags that will be applied to all the taggable resources and the stack itself.
*
* Default: {}
*
* @return {@code this}
* @param tags Stack tags that will be applied to all the taggable resources and the stack itself. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder tags(final java.util.Map tags) {
this.props.tags(tags);
return this;
}
/**
* Whether to enable termination protection for this stack.
*
* Default: false
*
* @return {@code this}
* @param terminationProtection Whether to enable termination protection for this stack. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder terminationProtection(final java.lang.Boolean terminationProtection) {
this.props.terminationProtection(terminationProtection);
return this;
}
/**
* The configuration for the VPC to be created or looked up.
*
* @return {@code this}
* @param vpcId The configuration for the VPC to be created or looked up. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder vpcId(final java.lang.String vpcId) {
this.props.vpcId(vpcId);
return this;
}
/**
* The list of CodeBuild VPC InterfacesVpcEndpointAwsServices to extend the defaultCodeBuildVPCInterfaces.
*
* @return {@code this}
* @param codeBuildVpcInterfaces The list of CodeBuild VPC InterfacesVpcEndpointAwsServices to extend the defaultCodeBuildVPCInterfaces. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder codeBuildVpcInterfaces(final java.util.List extends software.amazon.awscdk.services.ec2.InterfaceVpcEndpointAwsService> codeBuildVpcInterfaces) {
this.props.codeBuildVpcInterfaces(codeBuildVpcInterfaces);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.cdk.cicd.wrapper.VPCFromLookUpStack}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public io.github.cdklabs.cdk.cicd.wrapper.VPCFromLookUpStack build() {
return new io.github.cdklabs.cdk.cicd.wrapper.VPCFromLookUpStack(
this.scope,
this.id,
this.props.build()
);
}
}
}