# HostedZoneContextQuery

Query to hosted zone context provider.

Extends: [ContextLookupRoleOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.cloud_assembly_schema.ContextLookupRoleOptions.html)

- Source: [`lib/cloud-assembly/context-queries.ts`](https://github.com/aws/aws-cdk-cli/blob/HEAD/packages/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/context-queries.ts)
- Type last changed: v2.160.0 · 24 Sep 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';

declare const assumeRoleAdditionalOptions: any;
const hostedZoneContextQuery: cloud_assembly_schema.HostedZoneContextQuery = {
  account: 'account',
  domainName: 'domainName',
  region: 'region',

  // the properties below are optional
  assumeRoleAdditionalOptions: {
    assumeRoleAdditionalOptionsKey: assumeRoleAdditionalOptions,
  },
  lookupRoleArn: 'lookupRoleArn',
  lookupRoleExternalId: 'lookupRoleExternalId',
  privateZone: false,
  vpcId: 'vpcId',
};
```

Python:

```python
from aws_cdk.cloud_assembly_schema import HostedZoneContextQuery
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema

# assume_role_additional_options: Any

hosted_zone_context_query = HostedZoneContextQuery(
    account="account",
    domain_name="domainName",
    region="region",

    # the properties below are optional
    assume_role_additional_options={
        "assume_role_additional_options_key": assume_role_additional_options
    },
    lookup_role_arn="lookupRoleArn",
    lookup_role_external_id="lookupRoleExternalId",
    private_zone=False,
    vpc_id="vpcId"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cloud_assembly_schema.*;

Object assumeRoleAdditionalOptions;

HostedZoneContextQuery hostedZoneContextQuery = HostedZoneContextQuery.builder()
        .account("account")
        .domainName("domainName")
        .region("region")

        // the properties below are optional
        .assumeRoleAdditionalOptions(Map.of(
                "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions))
        .lookupRoleArn("lookupRoleArn")
        .lookupRoleExternalId("lookupRoleExternalId")
        .privateZone(false)
        .vpcId("vpcId")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Cloud_assembly_schema;

var assumeRoleAdditionalOptions;

var hostedZoneContextQuery = new HostedZoneContextQuery {
    Account = "account",
    DomainName = "domainName",
    Region = "region",

    // the properties below are optional
    AssumeRoleAdditionalOptions = new Dictionary<string, object> {
        { "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions }
    },
    LookupRoleArn = "lookupRoleArn",
    LookupRoleExternalId = "lookupRoleExternalId",
    PrivateZone = false,
    VpcId = "vpcId"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var assumeRoleAdditionalOptions interface{}

hostedZoneContextQuery := &HostedZoneContextQuery{
	Account: jsii.String("account"),
	DomainName: jsii.String("domainName"),
	Region: jsii.String("region"),

	// the properties below are optional
	AssumeRoleAdditionalOptions: map[string]interface{}{
		"assumeRoleAdditionalOptionsKey": assumeRoleAdditionalOptions,
	},
	LookupRoleArn: jsii.String("lookupRoleArn"),
	LookupRoleExternalId: jsii.String("lookupRoleExternalId"),
	PrivateZone: jsii.Boolean(false),
	VpcId: jsii.String("vpcId"),
}
```

## Properties

- `account`: string (required) — Query account.

- `assumeRoleAdditionalOptions`: { [key: string]: any } — Additional options to pass to STS when assuming the lookup role.

  **Default:** No additional options.

  - `RoleArn` should not be used. Use the dedicated `lookupRoleArn` property instead.
  - `ExternalId` should not be used. Use the dedicated `lookupRoleExternalId` instead.

- `domainName`: string (required) — The domain name e.g. example.com to lookup.

- `lookupRoleArn`: string = None — The ARN of the role that should be used to look up the missing values.

- `lookupRoleExternalId`: string — The ExternalId that needs to be supplied while assuming this role.

  **Default:** No ExternalId will be supplied

- `privateZone`: boolean = false — True if the zone you want to find is a private hosted zone.

- `region`: string (required) — Query region.

- `vpcId`: string — The VPC ID to that the private zone must be associated with.

  **Default:** Required if privateZone=true

  If you provide VPC ID and privateZone is false, this will return no results
  and raise an error.
