@cloudcomponents/cdk-static-website
@cloudcomponents/cdk-static-website / StaticWebsite
-
Construct
↳
StaticWebsite
- addLambdaFunctionAssociation
- addLambdaFunctionAssociations
- onPrepare
- onSynthesize
- onValidate
- prepare
- synthesize
- toString
- validate
- isConstruct
• new StaticWebsite(scope
, id
, props?
)
Name | Type |
---|---|
scope |
Construct |
id |
string |
props |
StaticWebsiteProps |
Construct.constructor
• Readonly
distribution: CloudFrontWebDistribution
• Readonly
node: ConstructNode
The construct tree node associated with this construct.
stability
stable
Construct.node
▸ addLambdaFunctionAssociation(assosiation
): void
Name | Type |
---|---|
assosiation |
LambdaFunctionAssociation |
void
▸ addLambdaFunctionAssociations(assosiations
): void
Name | Type |
---|---|
assosiations |
LambdaFunctionAssociation [] |
void
▸ Protected
onPrepare(): void
Perform final modifications before synthesis.
This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.
This is an advanced framework feature. Only use this if you understand the implications.
stability
stable
void
Construct.onPrepare
▸ Protected
onSynthesize(session
): void
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
stability
stable
Name | Type | Description |
---|---|---|
session |
ISynthesisSession |
The synthesis session. |
void
Construct.onSynthesize
▸ Protected
onValidate(): string
[]
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
stability
stable
string
[]
An array of validation error messages, or an empty array if the construct is valid.
Construct.onValidate
▸ Protected
prepare(): void
Perform final modifications before synthesis.
This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.
This is an advanced framework feature. Only use this if you understand the implications.
stability
stable
void
Construct.prepare
▸ Protected
synthesize(session
): void
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
stability
stable
Name | Type | Description |
---|---|---|
session |
ISynthesisSession |
The synthesis session. |
void
Construct.synthesize
▸ toString(): string
Returns a string representation of this construct.
stability
stable
string
Construct.toString
▸ Protected
validate(): string
[]
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
stability
stable
string
[]
An array of validation error messages, or an empty array if the construct is valid.
Construct.validate
▸ Static
isConstruct(x
): x is Construct
Return whether the given object is a Construct.
stability
stable
Name | Type |
---|---|
x |
any |
x is Construct
Construct.isConstruct
@cloudcomponents/cdk-static-website / WebsiteAliasRecord
-
Construct
↳
WebsiteAliasRecord
• new WebsiteAliasRecord(scope
, id
, props
)
Name | Type |
---|---|
scope |
Construct |
id |
string |
props |
WebsiteAliasRecordProps |
Construct.constructor
• Readonly
node: ConstructNode
The construct tree node associated with this construct.
stability
stable
Construct.node
▸ Protected
onPrepare(): void
Perform final modifications before synthesis.
This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.
This is an advanced framework feature. Only use this if you understand the implications.
stability
stable
void
Construct.onPrepare
▸ Protected
onSynthesize(session
): void
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
stability
stable
Name | Type | Description |
---|---|---|
session |
ISynthesisSession |
The synthesis session. |
void
Construct.onSynthesize
▸ Protected
onValidate(): string
[]
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
stability
stable
string
[]
An array of validation error messages, or an empty array if the construct is valid.
Construct.onValidate
▸ Protected
prepare(): void
Perform final modifications before synthesis.
This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.
This is an advanced framework feature. Only use this if you understand the implications.
stability
stable
void
Construct.prepare
▸ Protected
synthesize(session
): void
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
stability
stable
Name | Type | Description |
---|---|---|
session |
ISynthesisSession |
The synthesis session. |
void
Construct.synthesize
▸ toString(): string
Returns a string representation of this construct.
stability
stable
string
Construct.toString
▸ Protected
validate(): string
[]
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
stability
stable
string
[]
An array of validation error messages, or an empty array if the construct is valid.
Construct.validate
▸ Static
isConstruct(x
): x is Construct
Return whether the given object is a Construct.
stability
stable
Name | Type |
---|---|
x |
any |
x is Construct
Construct.isConstruct
@cloudcomponents/cdk-static-website / WebsiteBucket
-
Construct
↳
WebsiteBucket
• new WebsiteBucket(scope
, id
, props?
)
Name | Type |
---|---|
scope |
Construct |
id |
string |
props |
WebsiteBucketProps |
Construct.constructor
• Readonly
node: ConstructNode
The construct tree node associated with this construct.
stability
stable
Construct.node
• Readonly
s3OriginConfig: S3OriginConfig
▸ Protected
onPrepare(): void
Perform final modifications before synthesis.
This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.
This is an advanced framework feature. Only use this if you understand the implications.
stability
stable
void
Construct.onPrepare
▸ Protected
onSynthesize(session
): void
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
stability
stable
Name | Type | Description |
---|---|---|
session |
ISynthesisSession |
The synthesis session. |
void
Construct.onSynthesize
▸ Protected
onValidate(): string
[]
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
stability
stable
string
[]
An array of validation error messages, or an empty array if the construct is valid.
Construct.onValidate
▸ Protected
prepare(): void
Perform final modifications before synthesis.
This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.
This is an advanced framework feature. Only use this if you understand the implications.
stability
stable
void
Construct.prepare
▸ Protected
synthesize(session
): void
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
stability
stable
Name | Type | Description |
---|---|---|
session |
ISynthesisSession |
The synthesis session. |
void
Construct.synthesize
▸ toString(): string
Returns a string representation of this construct.
stability
stable
string
Construct.toString
▸ Protected
validate(): string
[]
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
stability
stable
string
[]
An array of validation error messages, or an empty array if the construct is valid.
Construct.validate
▸ Static
isConstruct(x
): x is Construct
Return whether the given object is a Construct.
stability
stable
Name | Type |
---|---|
x |
any |
x is Construct
Construct.isConstruct
@cloudcomponents/cdk-static-website / AliasProps
-
AliasConfiguration
↳
AliasProps
• Readonly
acmCertRef: string
(deprecated) ARN of an AWS Certificate Manager (ACM) certificate.
deprecated
AliasConfiguration.acmCertRef
• Readonly
domainName: string
The domain name for the site like 'example.com'
• Readonly
names: string
[]
(deprecated) Domain names on the certificate.
Both main domain name and Subject Alternative Names.
deprecated
AliasConfiguration.names
• Optional
Readonly
privateZone: boolean
Allow searching a private hosted zone.
default
false
• Optional
Readonly
securityPolicy: SecurityPolicyProtocol
(deprecated) The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.
CloudFront serves your objects only to browsers or devices that support at least the SSL version that you specify.
default
- SSLv3 if sslMethod VIP, TLSv1 if sslMethod SNI
deprecated
AliasConfiguration.securityPolicy
• Optional
Readonly
sslMethod: SSLMethod
(deprecated) How CloudFront should serve HTTPS requests.
See the notes on SSLMethod if you wish to use other SSL termination types.
default
SSLMethod.SNI
see
https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html
deprecated
AliasConfiguration.sslMethod
• Optional
Readonly
vpcId: string
Specifies the ID of the VPC associated with a private hosted zone.
If a VPC ID is provided and privateZone is false, no results will be returned and an error will be raised
default
- No VPC ID
@cloudcomponents/cdk-static-website / StaticWebsiteProps
-
↳
StaticWebsiteProps
- aliasConfiguration
- bucketConfiguration
- bucketName
- disableIPv6
- disableUpload
- errorConfigurations
- removalPolicy
- source
- webACLId
- websiteErrorDocument
- websiteIndexDocument
• Optional
Readonly
aliasConfiguration: AliasProps
AliasConfiguration is used to configured CloudFront to respond to requests on custom domain names.
default
- No custom domain names are set up
• Optional
Readonly
bucketConfiguration: WebsiteBucketProps
BucketConfiguration is used to configured the S3 website bucket
default
- The website bucket is provided with default values
• Optional
Readonly
bucketName: string
Name of the bucket
default
- Assigned by CloudFormation (recommended).
• Optional
Readonly
disableIPv6: boolean
An override flag that allows you to turn off support for IPv6 if required.
default
- Cloudfront IPv6 support is enabled and if you've supplied an aliasConfiguration, an
AAAA record will be created for your service, set this to true to switch this off.
• Optional
Readonly
disableUpload: boolean
Disable website deployment
default
- false
WebsiteBucketProps.disableUpload
• Optional
Readonly
errorConfigurations: CustomErrorResponseProperty
[]
How CloudFront should handle requests that are not successful (e.g., PageNotFound).
default
- No custom error responses.
• Optional
Readonly
removalPolicy: RemovalPolicy
Policy to apply when the bucket is removed from this stack.
default
- The bucket will be orphaned.
WebsiteBucketProps.removalPolicy
• Optional
Readonly
source: string
The source from which to deploy the website
default
- Dummy placeholder
• Optional
Readonly
webACLId: string
AWS WAF WebACL to associate with this CloudFront distribution
default
- No AWS Web Application Firewall web access control list (web ACL)
• Optional
Readonly
websiteErrorDocument: string
The error page for the site like 'error.html'
default
- error.html
WebsiteBucketProps.websiteErrorDocument
• Optional
Readonly
websiteIndexDocument: string
The index page for the site like 'index.html'
default
- index.html
WebsiteBucketProps.websiteIndexDocument
@cloudcomponents/cdk-static-website / WebsiteAliasRecordProps
• Optional
Readonly
disableIPv6: boolean
We support IPv6 and add an AAAA record by default, but you can turn it off
• Readonly
domainName: string
The domain name for the site like 'example.com'
• Optional
Readonly
privateZone: boolean
Allow searching a private hosted zone.
default
false
• Readonly
recordNames: string
[]
Names for the records.
• Readonly
target: IAliasRecordTarget
Target for the alias record
• Optional
Readonly
vpcId: string
Specifies the ID of the VPC associated with a private hosted zone.
If a VPC ID is provided and privateZone is false, no results will be returned and an error will be raised
default
- No VPC ID
@cloudcomponents/cdk-static-website / WebsiteBucketProps
-
WebsiteBucketProps
• Optional
Readonly
bucketName: string
Name of the bucket
default
- Assigned by CloudFormation (recommended).
• Optional
Readonly
disableUpload: boolean
Disable website deployment
default
- false
• Optional
Readonly
removalPolicy: RemovalPolicy
Policy to apply when the bucket is removed from this stack.
default
- The bucket will be orphaned.
• Optional
Readonly
source: string
The source from which to deploy the website
default
- Dummy placeholder
• Optional
Readonly
websiteErrorDocument: string
The error page for the site like 'error.html'
default
- error.html
• Optional
Readonly
websiteIndexDocument: string
The index page for the site like 'index.html'
default
- index.html