Skip to content
v2.278.0

PrivateHostedZoneAttributes Struct ​

Reference to a private hosted zone.

Example ​

ts
const privateZoneFromAttributes = route53.PrivateHostedZone.fromPrivateHostedZoneAttributes(this, 'MyPrivateZone', {
  zoneName: 'example.local',
  hostedZoneId: 'ZOJJZC49E0EPZ',
});

// Does not know zoneName
const privateZoneFromId = route53.PrivateHostedZone.fromPrivateHostedZoneId(this, 'MyPrivateZone', 'ZOJJZC49E0EPZ');
python
private_zone_from_attributes = route53.PrivateHostedZone.from_private_hosted_zone_attributes(self, "MyPrivateZone",
    zone_name="example.local",
    hosted_zone_id="ZOJJZC49E0EPZ"
)

# Does not know zoneName
private_zone_from_id = route53.PrivateHostedZone.from_private_hosted_zone_id(self, "MyPrivateZone", "ZOJJZC49E0EPZ")
java
IPrivateHostedZone privateZoneFromAttributes = PrivateHostedZone.fromPrivateHostedZoneAttributes(this, "MyPrivateZone", PrivateHostedZoneAttributes.builder()
        .zoneName("example.local")
        .hostedZoneId("ZOJJZC49E0EPZ")
        .build());

// Does not know zoneName
IPrivateHostedZone privateZoneFromId = PrivateHostedZone.fromPrivateHostedZoneId(this, "MyPrivateZone", "ZOJJZC49E0EPZ");
csharp
// Install: dotnet add package Amazon.CDK.Lib
var privateZoneFromAttributes = PrivateHostedZone.FromPrivateHostedZoneAttributes(this, "MyPrivateZone", new PrivateHostedZoneAttributes {
    ZoneName = "example.local",
    HostedZoneId = "ZOJJZC49E0EPZ"
});

// Does not know zoneName
var privateZoneFromId = PrivateHostedZone.FromPrivateHostedZoneId(this, "MyPrivateZone", "ZOJJZC49E0EPZ");
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
privateZoneFromAttributes := route53.PrivateHostedZone_FromPrivateHostedZoneAttributes(this, jsii.String("MyPrivateZone"), &PrivateHostedZoneAttributes{
	ZoneName: jsii.String("example.local"),
	HostedZoneId: jsii.String("ZOJJZC49E0EPZ"),
})

// Does not know zoneName
privateZoneFromId := route53.PrivateHostedZone_FromPrivateHostedZoneId(this, jsii.String("MyPrivateZone"), jsii.String("ZOJJZC49E0EPZ"))

Properties ​

hostedZoneIdstringhosted_zone_idstrhostedZoneIdStringHostedZoneIdstringHostedZoneId*string required #
Identifier of the hosted zone.
zoneNamestringzone_namestrzoneNameStringZoneNamestringZoneName*string required #
Name of the hosted zone.