AWS Static Website v0.4.0 published on Wednesday, Apr 19, 2023 by Pulumi
aws-static-website.Website
Explore with Pulumi AI
AWS Static Website v0.4.0 published on Wednesday, Apr 19, 2023 by Pulumi
Create Website Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Website(name: string, args: WebsiteArgs, opts?: CustomResourceOptions);
@overload
def Website(resource_name: str,
args: WebsiteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Website(resource_name: str,
opts: Optional[ResourceOptions] = None,
site_path: Optional[str] = None,
index_html: Optional[str] = None,
cache_ttl: Optional[float] = None,
cdn_args: Optional[CDNArgsArgs] = None,
certificate_arn: Optional[str] = None,
error404: Optional[str] = None,
add_website_version_header: Optional[bool] = None,
price_class: Optional[str] = None,
atomic_deployments: Optional[bool] = None,
subdomain: Optional[str] = None,
target_domain: Optional[str] = None,
with_cdn: Optional[bool] = None,
with_logs: Optional[bool] = None)
func NewWebsite(ctx *Context, name string, args WebsiteArgs, opts ...ResourceOption) (*Website, error)
public Website(string name, WebsiteArgs args, CustomResourceOptions? opts = null)
public Website(String name, WebsiteArgs args)
public Website(String name, WebsiteArgs args, CustomResourceOptions options)
type: aws-static-website:Website
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args WebsiteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args WebsiteArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WebsiteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WebsiteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WebsiteArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var websiteResource = new AwsStaticWebsite.Website("websiteResource", new()
{
SitePath = "string",
IndexHTML = "string",
CacheTTL = 0,
CdnArgs = new AwsStaticWebsite.Inputs.CDNArgsArgs
{
CloudfrontFunctionAssociations = new[]
{
new Aws.CloudFront.Inputs.DistributionOrderedCacheBehaviorFunctionAssociationArgs
{
EventType = "string",
FunctionArn = "string",
},
},
ForwardedValues = new Aws.CloudFront.Inputs.DistributionDefaultCacheBehaviorForwardedValuesArgs
{
Cookies = new Aws.CloudFront.Inputs.DistributionDefaultCacheBehaviorForwardedValuesCookiesArgs
{
Forward = "string",
WhitelistedNames = new[]
{
"string",
},
},
QueryString = false,
Headers = new[]
{
"string",
},
QueryStringCacheKeys = new[]
{
"string",
},
},
LambdaFunctionAssociations = new[]
{
new Aws.CloudFront.Inputs.DistributionOrderedCacheBehaviorLambdaFunctionAssociationArgs
{
EventType = "string",
LambdaArn = "string",
IncludeBody = false,
},
},
},
CertificateARN = "string",
Error404 = "string",
AddWebsiteVersionHeader = false,
PriceClass = "string",
AtomicDeployments = false,
Subdomain = "string",
TargetDomain = "string",
WithCDN = false,
WithLogs = false,
});
example, err := awsstaticwebsite.NewWebsite(ctx, "websiteResource", &awsstaticwebsite.WebsiteArgs{
SitePath: pulumi.String("string"),
IndexHTML: pulumi.String("string"),
CacheTTL: pulumi.Float64(0),
CdnArgs: &awsstaticwebsite.CDNArgsArgs{
CloudfrontFunctionAssociations: cloudfront.DistributionOrderedCacheBehaviorFunctionAssociationArray{
&cloudfront.DistributionOrderedCacheBehaviorFunctionAssociationArgs{
EventType: pulumi.String("string"),
FunctionArn: pulumi.String("string"),
},
},
ForwardedValues: &cloudfront.DistributionDefaultCacheBehaviorForwardedValuesArgs{
Cookies: &cloudfront.DistributionDefaultCacheBehaviorForwardedValuesCookiesArgs{
Forward: pulumi.String("string"),
WhitelistedNames: pulumi.StringArray{
pulumi.String("string"),
},
},
QueryString: pulumi.Bool(false),
Headers: pulumi.StringArray{
pulumi.String("string"),
},
QueryStringCacheKeys: pulumi.StringArray{
pulumi.String("string"),
},
},
LambdaFunctionAssociations: cloudfront.DistributionOrderedCacheBehaviorLambdaFunctionAssociationArray{
&cloudfront.DistributionOrderedCacheBehaviorLambdaFunctionAssociationArgs{
EventType: pulumi.String("string"),
LambdaArn: pulumi.String("string"),
IncludeBody: pulumi.Bool(false),
},
},
},
CertificateARN: pulumi.String("string"),
Error404: pulumi.String("string"),
AddWebsiteVersionHeader: pulumi.Bool(false),
PriceClass: pulumi.String("string"),
AtomicDeployments: pulumi.Bool(false),
Subdomain: pulumi.String("string"),
TargetDomain: pulumi.String("string"),
WithCDN: pulumi.Bool(false),
WithLogs: pulumi.Bool(false),
})
var websiteResource = new Website("websiteResource", WebsiteArgs.builder()
.sitePath("string")
.indexHTML("string")
.cacheTTL(0)
.cdnArgs(CDNArgs.builder()
.cloudfrontFunctionAssociations(DistributionOrderedCacheBehaviorFunctionAssociationArgs.builder()
.eventType("string")
.functionArn("string")
.build())
.forwardedValues(DistributionDefaultCacheBehaviorForwardedValuesArgs.builder()
.cookies(DistributionDefaultCacheBehaviorForwardedValuesCookiesArgs.builder()
.forward("string")
.whitelistedNames("string")
.build())
.queryString(false)
.headers("string")
.queryStringCacheKeys("string")
.build())
.lambdaFunctionAssociations(DistributionOrderedCacheBehaviorLambdaFunctionAssociationArgs.builder()
.eventType("string")
.lambdaArn("string")
.includeBody(false)
.build())
.build())
.certificateARN("string")
.error404("string")
.addWebsiteVersionHeader(false)
.priceClass("string")
.atomicDeployments(false)
.subdomain("string")
.targetDomain("string")
.withCDN(false)
.withLogs(false)
.build());
website_resource = aws_static_website.Website("websiteResource",
site_path="string",
index_html="string",
cache_ttl=0,
cdn_args=aws_static_website.CDNArgsArgs(
cloudfront_function_associations=[aws.cloudfront.DistributionOrderedCacheBehaviorFunctionAssociationArgs(
event_type="string",
function_arn="string",
)],
forwarded_values=aws.cloudfront.DistributionDefaultCacheBehaviorForwardedValuesArgs(
cookies=aws.cloudfront.DistributionDefaultCacheBehaviorForwardedValuesCookiesArgs(
forward="string",
whitelisted_names=["string"],
),
query_string=False,
headers=["string"],
query_string_cache_keys=["string"],
),
lambda_function_associations=[aws.cloudfront.DistributionOrderedCacheBehaviorLambdaFunctionAssociationArgs(
event_type="string",
lambda_arn="string",
include_body=False,
)],
),
certificate_arn="string",
error404="string",
add_website_version_header=False,
price_class="string",
atomic_deployments=False,
subdomain="string",
target_domain="string",
with_cdn=False,
with_logs=False)
const websiteResource = new aws_static_website.Website("websiteResource", {
sitePath: "string",
indexHTML: "string",
cacheTTL: 0,
cdnArgs: {
cloudfrontFunctionAssociations: [{
eventType: "string",
functionArn: "string",
}],
forwardedValues: {
cookies: {
forward: "string",
whitelistedNames: ["string"],
},
queryString: false,
headers: ["string"],
queryStringCacheKeys: ["string"],
},
lambdaFunctionAssociations: [{
eventType: "string",
lambdaArn: "string",
includeBody: false,
}],
},
certificateARN: "string",
error404: "string",
addWebsiteVersionHeader: false,
priceClass: "string",
atomicDeployments: false,
subdomain: "string",
targetDomain: "string",
withCDN: false,
withLogs: false,
});
type: aws-static-website:Website
properties:
addWebsiteVersionHeader: false
atomicDeployments: false
cacheTTL: 0
cdnArgs:
cloudfrontFunctionAssociations:
- eventType: string
functionArn: string
forwardedValues:
cookies:
forward: string
whitelistedNames:
- string
headers:
- string
queryString: false
queryStringCacheKeys:
- string
lambdaFunctionAssociations:
- eventType: string
includeBody: false
lambdaArn: string
certificateARN: string
error404: string
indexHTML: string
priceClass: string
sitePath: string
subdomain: string
targetDomain: string
withCDN: false
withLogs: false
Website Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Website resource accepts the following input properties:
- Site
Path string - The root directory containing the website's contents.
- Add
Website boolVersion Header - Enable a cache control header to be attached to every request from an Cloudfront Function.
- Atomic
Deployments bool - Provision a new bucket on each deployment.
- Cache
TTL double - TTL in seconds for cached objects.
- Cdn
Args Pulumi.Aws Static Website. Inputs. CDNArgs - Optional arguments used to configure the CDN.
- Certificate
ARN string - The ARN of the ACM certificate to use for serving HTTPS. If one is not provided, a certificate will be created during the provisioning process.
- Error404 string
- default 404 page
- Index
HTML string - The default document for the site. Defaults to index.html
- Price
Class string - The price class to use for the CloudFront configuration. Defaults to 100 if not specified. Valid values are
all
,100
, and200
- Subdomain string
- An optional subdomain that can be used to serve the content. This can typically be used to provision a www alias or if a deeply nested subdomain is needed (e.g. foo.bar.baz.com).
- Target
Domain string - The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- With
CDN bool - Provision CloudFront CDN to serve content.
- With
Logs bool - Provision a bucket to hold access logs.
- Site
Path string - The root directory containing the website's contents.
- Add
Website boolVersion Header - Enable a cache control header to be attached to every request from an Cloudfront Function.
- Atomic
Deployments bool - Provision a new bucket on each deployment.
- Cache
TTL float64 - TTL in seconds for cached objects.
- Cdn
Args CDNArgsArgs - Optional arguments used to configure the CDN.
- Certificate
ARN string - The ARN of the ACM certificate to use for serving HTTPS. If one is not provided, a certificate will be created during the provisioning process.
- Error404 string
- default 404 page
- Index
HTML string - The default document for the site. Defaults to index.html
- Price
Class string - The price class to use for the CloudFront configuration. Defaults to 100 if not specified. Valid values are
all
,100
, and200
- Subdomain string
- An optional subdomain that can be used to serve the content. This can typically be used to provision a www alias or if a deeply nested subdomain is needed (e.g. foo.bar.baz.com).
- Target
Domain string - The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- With
CDN bool - Provision CloudFront CDN to serve content.
- With
Logs bool - Provision a bucket to hold access logs.
- site
Path String - The root directory containing the website's contents.
- add
Website BooleanVersion Header - Enable a cache control header to be attached to every request from an Cloudfront Function.
- atomic
Deployments Boolean - Provision a new bucket on each deployment.
- cache
TTL Double - TTL in seconds for cached objects.
- cdn
Args CDNArgs - Optional arguments used to configure the CDN.
- certificate
ARN String - The ARN of the ACM certificate to use for serving HTTPS. If one is not provided, a certificate will be created during the provisioning process.
- error404 String
- default 404 page
- index
HTML String - The default document for the site. Defaults to index.html
- price
Class String - The price class to use for the CloudFront configuration. Defaults to 100 if not specified. Valid values are
all
,100
, and200
- subdomain String
- An optional subdomain that can be used to serve the content. This can typically be used to provision a www alias or if a deeply nested subdomain is needed (e.g. foo.bar.baz.com).
- target
Domain String - The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- with
CDN Boolean - Provision CloudFront CDN to serve content.
- with
Logs Boolean - Provision a bucket to hold access logs.
- site
Path string - The root directory containing the website's contents.
- add
Website booleanVersion Header - Enable a cache control header to be attached to every request from an Cloudfront Function.
- atomic
Deployments boolean - Provision a new bucket on each deployment.
- cache
TTL number - TTL in seconds for cached objects.
- cdn
Args CDNArgs - Optional arguments used to configure the CDN.
- certificate
ARN string - The ARN of the ACM certificate to use for serving HTTPS. If one is not provided, a certificate will be created during the provisioning process.
- error404 string
- default 404 page
- index
HTML string - The default document for the site. Defaults to index.html
- price
Class string - The price class to use for the CloudFront configuration. Defaults to 100 if not specified. Valid values are
all
,100
, and200
- subdomain string
- An optional subdomain that can be used to serve the content. This can typically be used to provision a www alias or if a deeply nested subdomain is needed (e.g. foo.bar.baz.com).
- target
Domain string - The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- with
CDN boolean - Provision CloudFront CDN to serve content.
- with
Logs boolean - Provision a bucket to hold access logs.
- site_
path str - The root directory containing the website's contents.
- add_
website_ boolversion_ header - Enable a cache control header to be attached to every request from an Cloudfront Function.
- atomic_
deployments bool - Provision a new bucket on each deployment.
- cache_
ttl float - TTL in seconds for cached objects.
- cdn_
args CDNArgsArgs - Optional arguments used to configure the CDN.
- certificate_
arn str - The ARN of the ACM certificate to use for serving HTTPS. If one is not provided, a certificate will be created during the provisioning process.
- error404 str
- default 404 page
- index_
html str - The default document for the site. Defaults to index.html
- price_
class str - The price class to use for the CloudFront configuration. Defaults to 100 if not specified. Valid values are
all
,100
, and200
- subdomain str
- An optional subdomain that can be used to serve the content. This can typically be used to provision a www alias or if a deeply nested subdomain is needed (e.g. foo.bar.baz.com).
- target_
domain str - The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- with_
cdn bool - Provision CloudFront CDN to serve content.
- with_
logs bool - Provision a bucket to hold access logs.
- site
Path String - The root directory containing the website's contents.
- add
Website BooleanVersion Header - Enable a cache control header to be attached to every request from an Cloudfront Function.
- atomic
Deployments Boolean - Provision a new bucket on each deployment.
- cache
TTL Number - TTL in seconds for cached objects.
- cdn
Args Property Map - Optional arguments used to configure the CDN.
- certificate
ARN String - The ARN of the ACM certificate to use for serving HTTPS. If one is not provided, a certificate will be created during the provisioning process.
- error404 String
- default 404 page
- index
HTML String - The default document for the site. Defaults to index.html
- price
Class String - The price class to use for the CloudFront configuration. Defaults to 100 if not specified. Valid values are
all
,100
, and200
- subdomain String
- An optional subdomain that can be used to serve the content. This can typically be used to provision a www alias or if a deeply nested subdomain is needed (e.g. foo.bar.baz.com).
- target
Domain String - The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- with
CDN Boolean - Provision CloudFront CDN to serve content.
- with
Logs Boolean - Provision a bucket to hold access logs.
Outputs
All input properties are implicitly available as output properties. Additionally, the Website resource produces the following output properties:
- Bucket
Name string - The name of the s3 bucket containing the website contents.
- Bucket
Website stringURL - The website URL for the s3 bucket.
- Website
URL string - The URL to access the website
- Cdn
Domain stringName - The domain name for the CDN.
- Cdn
URL string - The URL for the CDN
- Logs
Bucket stringName - The name of the s3 bucket containing the access logs.
- Bucket
Name string - The name of the s3 bucket containing the website contents.
- Bucket
Website stringURL - The website URL for the s3 bucket.
- Website
URL string - The URL to access the website
- Cdn
Domain stringName - The domain name for the CDN.
- Cdn
URL string - The URL for the CDN
- Logs
Bucket stringName - The name of the s3 bucket containing the access logs.
- bucket
Name String - The name of the s3 bucket containing the website contents.
- bucket
Website StringURL - The website URL for the s3 bucket.
- website
URL String - The URL to access the website
- cdn
Domain StringName - The domain name for the CDN.
- cdn
URL String - The URL for the CDN
- logs
Bucket StringName - The name of the s3 bucket containing the access logs.
- bucket
Name string - The name of the s3 bucket containing the website contents.
- bucket
Website stringURL - The website URL for the s3 bucket.
- website
URL string - The URL to access the website
- cdn
Domain stringName - The domain name for the CDN.
- cdn
URL string - The URL for the CDN
- logs
Bucket stringName - The name of the s3 bucket containing the access logs.
- bucket_
name str - The name of the s3 bucket containing the website contents.
- bucket_
website_ strurl - The website URL for the s3 bucket.
- website_
url str - The URL to access the website
- cdn_
domain_ strname - The domain name for the CDN.
- cdn_
url str - The URL for the CDN
- logs_
bucket_ strname - The name of the s3 bucket containing the access logs.
- bucket
Name String - The name of the s3 bucket containing the website contents.
- bucket
Website StringURL - The website URL for the s3 bucket.
- website
URL String - The URL to access the website
- cdn
Domain StringName - The domain name for the CDN.
- cdn
URL String - The URL for the CDN
- logs
Bucket StringName - The name of the s3 bucket containing the access logs.
Supporting Types
CDNArgs, CDNArgsArgs
- Cloudfront
Function List<Pulumi.Associations Aws. Cloud Front. Inputs. Distribution Ordered Cache Behavior Function Association> - A config block that triggers a cloudfront function with specific actions.
- Forwarded
Values Pulumi.Aws. Cloud Front. Inputs. Distribution Default Cache Behavior Forwarded Values - The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers. This type is defined in the AWS Classic package.
- Lambda
Function List<Pulumi.Associations Aws. Cloud Front. Inputs. Distribution Ordered Cache Behavior Lambda Function Association> - A config block that triggers a lambda function with specific actions.
- Cloudfront
Function DistributionAssociations Ordered Cache Behavior Function Association - A config block that triggers a cloudfront function with specific actions.
- Forwarded
Values DistributionDefault Cache Behavior Forwarded Values - The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers. This type is defined in the AWS Classic package.
- Lambda
Function DistributionAssociations Ordered Cache Behavior Lambda Function Association - A config block that triggers a lambda function with specific actions.
- cloudfront
Function List<DistributionAssociations Ordered Cache Behavior Function Association> - A config block that triggers a cloudfront function with specific actions.
- forwarded
Values DistributionDefault Cache Behavior Forwarded Values - The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers. This type is defined in the AWS Classic package.
- lambda
Function List<DistributionAssociations Ordered Cache Behavior Lambda Function Association> - A config block that triggers a lambda function with specific actions.
- cloudfront
Function pulumiAssociations Awstypesinputcloudfront Distribution Ordered Cache Behavior Function Association[] - A config block that triggers a cloudfront function with specific actions.
- forwarded
Values pulumiAwstypesinputcloudfront Distribution Default Cache Behavior Forwarded Values - The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers. This type is defined in the AWS Classic package.
- lambda
Function pulumiAssociations Awstypesinputcloudfront Distribution Ordered Cache Behavior Lambda Function Association[] - A config block that triggers a lambda function with specific actions.
- cloudfront_
function_ Sequence[pulumi_associations aws.cloudfront. Distribution Ordered Cache Behavior Function Association Args] - A config block that triggers a cloudfront function with specific actions.
- forwarded_
values pulumi_aws.cloudfront. Distribution Default Cache Behavior Forwarded Values Args - The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers. This type is defined in the AWS Classic package.
- lambda_
function_ Sequence[pulumi_associations aws.cloudfront. Distribution Ordered Cache Behavior Lambda Function Association Args] - A config block that triggers a lambda function with specific actions.
- cloudfront
Function List<Property Map>Associations - A config block that triggers a cloudfront function with specific actions.
- forwarded
Values Property Map - The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers. This type is defined in the AWS Classic package.
- lambda
Function List<Property Map>Associations - A config block that triggers a lambda function with specific actions.
Package Details
- Repository
- aws-static-website pulumi/pulumi-aws-static-website
- License
AWS Static Website v0.4.0 published on Wednesday, Apr 19, 2023 by Pulumi