@aws-cdk_aws-apprunner-alpha.VpcConnector

class VpcConnector (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.AppRunner.Alpha.VpcConnector
Gogithub.com/aws/aws-cdk-go/awscdkapprunneralpha/v2#VpcConnector
Javasoftware.amazon.awscdk.services.apprunner.alpha.VpcConnector
Pythonaws_cdk.aws_apprunner_alpha.VpcConnector
TypeScript (source)@aws-cdk/aws-apprunner-alpha ยป VpcConnector

Implements IConstruct, IDependable, IResource, IVpcConnector, IConnectable

The App Runner VPC Connector.

Example

import * as ec2 from 'aws-cdk-lib/aws-ec2';

const vpc = new ec2.Vpc(this, 'Vpc', {
  ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16')
});

const vpcConnector = new apprunner.VpcConnector(this, 'VpcConnector', {
  vpc,
  vpcSubnets: vpc.selectSubnets({ subnetType: ec2.SubnetType.PUBLIC }),
  vpcConnectorName: 'MyVpcConnector',
});

new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
  vpcConnector,
});

Initializer

new VpcConnector(scope: Construct, id: string, props: VpcConnectorProps)

Parameters

  • scope Construct
  • id string
  • props VpcConnectorProps

Construct Props

NameTypeDescription
vpc๐Ÿ”นIVpcThe VPC for the VPC Connector.
securityGroups?๐Ÿ”นISecurityGroup[]A list of IDs of security groups that App Runner should use for access to AWS resources under the specified subnets.
vpcConnectorName?๐Ÿ”นstringThe name for the VpcConnector.
vpcSubnets?๐Ÿ”นSubnetSelectionWhere to place the VPC Connector within the VPC.

vpc๐Ÿ”น

Type: IVpc

The VPC for the VPC Connector.


securityGroups?๐Ÿ”น

Type: ISecurityGroup[] (optional, default: a new security group will be created in the specified VPC)

A list of IDs of security groups that App Runner should use for access to AWS resources under the specified subnets.


vpcConnectorName?๐Ÿ”น

Type: string (optional, default: a name generated by CloudFormation)

The name for the VpcConnector.


vpcSubnets?๐Ÿ”น

Type: SubnetSelection (optional, default: Private subnets.)

Where to place the VPC Connector within the VPC.

Properties

NameTypeDescription
connections๐Ÿ”นConnectionsAllows specifying security group connections for the VPC connector.
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.
vpcConnectorArn๐Ÿ”นstringThe ARN of the VPC connector.
vpcConnectorName๐Ÿ”นstringThe name of the VPC connector.
vpcConnectorRevision๐Ÿ”นnumberThe revision of the VPC connector.

connections๐Ÿ”น

Type: Connections

Allows specifying security group connections for the VPC connector.


env๐Ÿ”น

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.


vpcConnectorArn๐Ÿ”น

Type: string

The ARN of the VPC connector.


vpcConnectorName๐Ÿ”น

Type: string

The name of the VPC connector.


vpcConnectorRevision๐Ÿ”น

Type: number

The revision of the VPC connector.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromVpcConnectorAttributes(scope, id, attrs)๐Ÿ”นImport from VPC connector attributes.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromVpcConnectorAttributes(scope, id, attrs)๐Ÿ”น

public static fromVpcConnectorAttributes(scope: Construct, id: string, attrs: VpcConnectorAttributes): IVpcConnector

Parameters

  • scope Construct
  • id string
  • attrs VpcConnectorAttributes

Returns

  • IVpcConnector

Import from VPC connector attributes.