OriginIpAddressType Enum
The IP address type for the origin.
Determines whether CloudFront uses IPv4, IPv6, or both when connecting to the origin.
| Source | aws-cloudfront/lib/origin.ts |
|---|---|
| Type last changed |
Example
ts
const origin = new origins.HttpOrigin('www.example.com', {
ipAddressType: cloudfront.OriginIpAddressType.IPV6, // IPv4, IPv6, or DUALSTACK
});
new cloudfront.Distribution(this, 'Distribution', {
defaultBehavior: { origin },
});
python
origin = origins.HttpOrigin("www.example.com",
ip_address_type=cloudfront.OriginIpAddressType.IPV6
)
cloudfront.Distribution(self, "Distribution",
default_behavior=cloudfront.BehaviorOptions(origin=origin)
)
java
HttpOrigin origin = HttpOrigin.Builder.create("www.example.com")
.ipAddressType(OriginIpAddressType.IPV6)
.build();
Distribution.Builder.create(this, "Distribution")
.defaultBehavior(BehaviorOptions.builder().origin(origin).build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var origin = new HttpOrigin("www.example.com", new HttpOriginProps {
IpAddressType = OriginIpAddressType.IPV6
});
new Distribution(this, "Distribution", new DistributionProps {
DefaultBehavior = new BehaviorOptions { Origin = origin }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
origin := origins.NewHttpOrigin(jsii.String("www.example.com"), &HttpOriginProps{
IpAddressType: cloudfront.OriginIpAddressType_IPV6,
})
cloudfront.NewDistribution(this, jsii.String("Distribution"), &DistributionProps{
DefaultBehavior: &BehaviorOptions{
Origin: *Origin,
},
})
Members
| Member | Description |
|---|---|
IPV4 | Use only IPv4 addresses. |
IPV6 | Use only IPv6 addresses. |
DUALSTACK | Use both IPv4 and IPv6 addresses. |
Referenced by
FunctionUrlOriginProps.ipAddressTypeip_address_typeipAddressTypeIpAddressTypeIpAddressTypeHttpOriginProps.ipAddressTypeip_address_typeipAddressTypeIpAddressTypeIpAddressType