class VpcOrigin (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudFront.VpcOrigin |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#VpcOrigin |
![]() | software.amazon.awscdk.services.cloudfront.VpcOrigin |
![]() | aws_cdk.aws_cloudfront.VpcOrigin |
![]() | aws-cdk-lib » aws_cloudfront » VpcOrigin |
Implements
IConstruct
, IDependable
, IResource
, IVpc
, ITaggable
A CloudFront VPC Origin configuration.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
declare const vpcOriginEndpoint: cloudfront.VpcOriginEndpoint;
const vpcOrigin = new cloudfront.VpcOrigin(this, 'MyVpcOrigin', {
endpoint: vpcOriginEndpoint,
// the properties below are optional
httpPort: 123,
httpsPort: 123,
originSslProtocols: [cloudfront.OriginSslPolicy.SSL_V3],
protocolPolicy: cloudfront.OriginProtocolPolicy.HTTP_ONLY,
vpcOriginName: 'vpcOriginName',
});
Initializer
new VpcOrigin(scope: Construct, id: string, props: VpcOriginProps)
Parameters
- scope
Construct
- id
string
- props
Vpc
Origin Props
Construct Props
Name | Type | Description |
---|---|---|
endpoint | Vpc | The VPC origin endpoint. |
http | number | The HTTP port for the CloudFront VPC origin endpoint configuration. |
https | number | The HTTPS port of the CloudFront VPC origin endpoint configuration. |
origin | Origin [] | A list that contains allowed SSL/TLS protocols for this distribution. |
protocol | Origin | The origin protocol policy for the CloudFront VPC origin endpoint configuration. |
vpc | string | The name of the CloudFront VPC origin endpoint configuration. |
endpoint
Type:
Vpc
The VPC origin endpoint.
httpPort?
Type:
number
(optional, default: 80)
The HTTP port for the CloudFront VPC origin endpoint configuration.
httpsPort?
Type:
number
(optional, default: 443)
The HTTPS port of the CloudFront VPC origin endpoint configuration.
originSslProtocols?
Type:
Origin
[]
(optional, default: TLSv1.2)
A list that contains allowed SSL/TLS protocols for this distribution.
protocolPolicy?
Type:
Origin
(optional, default: OriginProtocolPolicy.MATCH_VIEWER)
The origin protocol policy for the CloudFront VPC origin endpoint configuration.
vpcOriginName?
Type:
string
(optional, default: generated from the id
)
The name of the CloudFront VPC origin endpoint configuration.
Properties
Name | Type | Description |
---|---|---|
cdk | Tag | TagManager to set, remove and format tags. |
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
vpc | string | The VPC origin ARN. |
vpc | string | The VPC origin ID. |
domain | string | The domain name of the CloudFront VPC origin endpoint configuration. |
cdkTagManager
Type:
Tag
TagManager to set, remove and format tags.
env
Type:
Resource
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.
vpcOriginArn
Type:
string
The VPC origin ARN.
vpcOriginId
Type:
string
The VPC origin ID.
domainName?
Type:
string
(optional)
The domain name of the CloudFront VPC origin endpoint configuration.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
static from | Import an existing VPC origin from its ARN. |
static from | Import an existing VPC origin from its attributes. |
static from | Import an existing VPC origin from its ID. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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 fromVpcOriginArn(scope, id, vpcOriginArn)
public static fromVpcOriginArn(scope: Construct, id: string, vpcOriginArn: string): IVpcOrigin
Parameters
- scope
Construct
- id
string
- vpcOriginArn
string
Returns
Import an existing VPC origin from its ARN.
static fromVpcOriginAttributes(scope, id, attrs)
public static fromVpcOriginAttributes(scope: Construct, id: string, attrs: VpcOriginAttributes): IVpcOrigin
Parameters
- scope
Construct
- id
string
- attrs
Vpc
Origin Attributes
Returns
Import an existing VPC origin from its attributes.
static fromVpcOriginId(scope, id, vpcOriginId)
public static fromVpcOriginId(scope: Construct, id: string, vpcOriginId: string): IVpcOrigin
Parameters
- scope
Construct
- id
string
- vpcOriginId
string
Returns
Import an existing VPC origin from its ID.