Experimental
@aws-cdk/aws-route53resolver-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
FirewallDomains Class
A list of domains.
| Stability | Experimental |
|---|---|
| Source | lib/firewall-domain-list.ts |
Example
ts
const blockList = new route53resolver.FirewallDomainList(this, 'BlockList', {
domains: route53resolver.FirewallDomains.fromList(['bad-domain.com', 'bot-domain.net']),
});
const s3List = new route53resolver.FirewallDomainList(this, 'S3List', {
domains: route53resolver.FirewallDomains.fromS3Url('s3://bucket/prefix/object'),
});
const assetList = new route53resolver.FirewallDomainList(this, 'AssetList', {
domains: route53resolver.FirewallDomains.fromAsset('/path/to/domains.txt'),
});
python
block_list = route53resolver.FirewallDomainList(self, "BlockList",
domains=route53resolver.FirewallDomains.from_list(["bad-domain.com", "bot-domain.net"])
)
s3_list = route53resolver.FirewallDomainList(self, "S3List",
domains=route53resolver.FirewallDomains.from_s3_url("s3://bucket/prefix/object")
)
asset_list = route53resolver.FirewallDomainList(self, "AssetList",
domains=route53resolver.FirewallDomains.from_asset("/path/to/domains.txt")
)
java
FirewallDomainList blockList = FirewallDomainList.Builder.create(this, "BlockList")
.domains(FirewallDomains.fromList(List.of("bad-domain.com", "bot-domain.net")))
.build();
FirewallDomainList s3List = FirewallDomainList.Builder.create(this, "S3List")
.domains(FirewallDomains.fromS3Url("s3://bucket/prefix/object"))
.build();
FirewallDomainList assetList = FirewallDomainList.Builder.create(this, "AssetList")
.domains(FirewallDomains.fromAsset("/path/to/domains.txt"))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Route53Resolver.Alpha
var blockList = new FirewallDomainList(this, "BlockList", new FirewallDomainListProps {
Domains = FirewallDomains.FromList(new [] { "bad-domain.com", "bot-domain.net" })
});
var s3List = new FirewallDomainList(this, "S3List", new FirewallDomainListProps {
Domains = FirewallDomains.FromS3Url("s3://bucket/prefix/object")
});
var assetList = new FirewallDomainList(this, "AssetList", new FirewallDomainListProps {
Domains = FirewallDomains.FromAsset("/path/to/domains.txt")
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkroute53resolveralpha/v2
blockList := route53resolver.NewFirewallDomainList(this, jsii.String("BlockList"), &FirewallDomainListProps{
Domains: route53resolver.FirewallDomains_FromList([]*string{
jsii.String("bad-domain.com"),
jsii.String("bot-domain.net"),
}),
})
s3List := route53resolver.NewFirewallDomainList(this, jsii.String("S3List"), &FirewallDomainListProps{
Domains: route53resolver.FirewallDomains_FromS3Url(jsii.String("s3://bucket/prefix/object")),
})
assetList := route53resolver.NewFirewallDomainList(this, jsii.String("AssetList"), &FirewallDomainListProps{
Domains: route53resolver.FirewallDomains_FromAsset(jsii.String("/path/to/domains.txt")),
})
Initializer
ts
new FirewallDomains()
python
FirewallDomains()
java
new FirewallDomains()
csharp
new FirewallDomains()
go
NewFirewallDomains()
Methods
bind(scope: Construct): DomainsConfigdef bind(self, scope: Construct) -> DomainsConfigpublic DomainsConfig bind(Construct scope)public DomainsConfig Bind(Construct scope)func Bind(Scope Construct) DomainsConfig #Binds the domains to a domain list.
fromAsset(assetPath: string): FirewallDomains // chainable@staticmethod def from_asset(asset_path: str) -> FirewallDomainspublic static FirewallDomains fromAsset(String assetPath)public static FirewallDomains FromAsset(string assetPath)func FromAsset(AssetPath *string) FirewallDomains static #Firewall domains created from a local disk path to a text file.
The file must be a text file (.txt extension) and must contain a single domain per line. It will be uploaded to S3.
1 parameter
Parameters
assetPathasset_pathassetPathassetPathAssetPath— path to the text file.
fromList(list: string[]): FirewallDomains // chainable@staticmethod def from_list(list: typing.List[str]) -> FirewallDomainspublic static FirewallDomains fromList(List<String> list)public static FirewallDomains FromList(string[] list)func FromList(List *[]*string) FirewallDomains static #Firewall domains created from a list of domains.
1 parameter
Parameters
listlistlistlistList— the list of domains.
fromS3(bucket: IBucket, key: string): FirewallDomains // chainable@staticmethod def from_s3(bucket: IBucket, key: str) -> FirewallDomainspublic static FirewallDomains fromS3(IBucket bucket, String key)public static FirewallDomains FromS3(IBucket bucket, string key)func FromS3(Bucket IBucket, Key *string) FirewallDomains static #Firewall domains created from a file stored in Amazon S3.
The file must be a text file and must contain a single domain per line. The content type of the S3 object must be plain/text.
2 parameters
Parameters
bucketbucketbucketbucketBucket— S3 bucket.keykeykeykeyKey— S3 key.
fromS3Url(url: string): FirewallDomains // chainable@staticmethod def from_s3_url(url: str) -> FirewallDomainspublic static FirewallDomains fromS3Url(String url)public static FirewallDomains FromS3Url(string url)func FromS3Url(Url *string) FirewallDomains static #Firewall domains created from the URL of a file stored in Amazon S3.
The file must be a text file and must contain a single domain per line. The content type of the S3 object must be plain/text.
1 parameter
Parameters
urlurlurlurlUrl— S3 bucket url (s3://bucket/prefix/objet).