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?: ComponentResourceOptions);@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, ComponentResourceOptions? opts = null)
public Website(String name, WebsiteArgs args)
public Website(String name, WebsiteArgs args, ComponentResourceOptions 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 ComponentResourceOptions
- 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 ComponentResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WebsiteArgs
- The arguments to resource properties.
- options ComponentResourceOptions
- 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.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={
        "cloudfront_function_associations": [{
            "event_type": "string",
            "function_arn": "string",
        }],
        "forwarded_values": {
            "cookies": {
                "forward": "string",
                "whitelisted_names": ["string"],
            },
            "query_string": False,
            "headers": ["string"],
            "query_string_cache_keys": ["string"],
        },
        "lambda_function_associations": [{
            "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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Website resource accepts the following input properties:
- SitePath string
- The root directory containing the website's contents.
- AddWebsite boolVersion Header 
- Enable a cache control header to be attached to every request from an Cloudfront Function.
- AtomicDeployments bool
- Provision a new bucket on each deployment.
- CacheTTL double
- TTL in seconds for cached objects.
- CdnArgs Pulumi.Aws Static Website. Inputs. CDNArgs 
- Optional arguments used to configure the CDN.
- CertificateARN 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
- IndexHTML string
- The default document for the site. Defaults to index.html
- PriceClass 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).
- TargetDomain string
- The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- WithCDN bool
- Provision CloudFront CDN to serve content.
- WithLogs bool
- Provision a bucket to hold access logs.
- SitePath string
- The root directory containing the website's contents.
- AddWebsite boolVersion Header 
- Enable a cache control header to be attached to every request from an Cloudfront Function.
- AtomicDeployments bool
- Provision a new bucket on each deployment.
- CacheTTL float64
- TTL in seconds for cached objects.
- CdnArgs CDNArgsArgs 
- Optional arguments used to configure the CDN.
- CertificateARN 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
- IndexHTML string
- The default document for the site. Defaults to index.html
- PriceClass 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).
- TargetDomain string
- The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- WithCDN bool
- Provision CloudFront CDN to serve content.
- WithLogs bool
- Provision a bucket to hold access logs.
- sitePath String
- The root directory containing the website's contents.
- addWebsite BooleanVersion Header 
- Enable a cache control header to be attached to every request from an Cloudfront Function.
- atomicDeployments Boolean
- Provision a new bucket on each deployment.
- cacheTTL Double
- TTL in seconds for cached objects.
- cdnArgs CDNArgs
- Optional arguments used to configure the CDN.
- certificateARN 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
- indexHTML String
- The default document for the site. Defaults to index.html
- priceClass 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).
- targetDomain String
- The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- withCDN Boolean
- Provision CloudFront CDN to serve content.
- withLogs Boolean
- Provision a bucket to hold access logs.
- sitePath string
- The root directory containing the website's contents.
- addWebsite booleanVersion Header 
- Enable a cache control header to be attached to every request from an Cloudfront Function.
- atomicDeployments boolean
- Provision a new bucket on each deployment.
- cacheTTL number
- TTL in seconds for cached objects.
- cdnArgs CDNArgs
- Optional arguments used to configure the CDN.
- certificateARN 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
- indexHTML string
- The default document for the site. Defaults to index.html
- priceClass 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).
- targetDomain string
- The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- withCDN boolean
- Provision CloudFront CDN to serve content.
- withLogs 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.
- sitePath String
- The root directory containing the website's contents.
- addWebsite BooleanVersion Header 
- Enable a cache control header to be attached to every request from an Cloudfront Function.
- atomicDeployments Boolean
- Provision a new bucket on each deployment.
- cacheTTL Number
- TTL in seconds for cached objects.
- cdnArgs Property Map
- Optional arguments used to configure the CDN.
- certificateARN 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
- indexHTML String
- The default document for the site. Defaults to index.html
- priceClass 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).
- targetDomain String
- The domain used to serve the content. A Route53 hosted zone must exist for this domain.
- withCDN Boolean
- Provision CloudFront CDN to serve content.
- withLogs 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:
- BucketName string
- The name of the s3 bucket containing the website contents.
- BucketWebsite stringURL 
- The website URL for the s3 bucket.
- WebsiteURL string
- The URL to access the website
- CdnDomain stringName 
- The domain name for the CDN.
- CdnURL string
- The URL for the CDN
- LogsBucket stringName 
- The name of the s3 bucket containing the access logs.
- BucketName string
- The name of the s3 bucket containing the website contents.
- BucketWebsite stringURL 
- The website URL for the s3 bucket.
- WebsiteURL string
- The URL to access the website
- CdnDomain stringName 
- The domain name for the CDN.
- CdnURL string
- The URL for the CDN
- LogsBucket stringName 
- The name of the s3 bucket containing the access logs.
- bucketName String
- The name of the s3 bucket containing the website contents.
- bucketWebsite StringURL 
- The website URL for the s3 bucket.
- websiteURL String
- The URL to access the website
- cdnDomain StringName 
- The domain name for the CDN.
- cdnURL String
- The URL for the CDN
- logsBucket StringName 
- The name of the s3 bucket containing the access logs.
- bucketName string
- The name of the s3 bucket containing the website contents.
- bucketWebsite stringURL 
- The website URL for the s3 bucket.
- websiteURL string
- The URL to access the website
- cdnDomain stringName 
- The domain name for the CDN.
- cdnURL string
- The URL for the CDN
- logsBucket 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.
- bucketName String
- The name of the s3 bucket containing the website contents.
- bucketWebsite StringURL 
- The website URL for the s3 bucket.
- websiteURL String
- The URL to access the website
- cdnDomain StringName 
- The domain name for the CDN.
- cdnURL String
- The URL for the CDN
- logsBucket StringName 
- The name of the s3 bucket containing the access logs.
Supporting Types
CDNArgs, CDNArgsArgs  
- CloudfrontFunction List<Pulumi.Associations Aws. Cloud Front. Inputs. Distribution Ordered Cache Behavior Function Association> 
- A config block that triggers a cloudfront function with specific actions.
- ForwardedValues 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.
- LambdaFunction 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.
- CloudfrontFunction DistributionAssociations Ordered Cache Behavior Function Association 
- A config block that triggers a cloudfront function with specific actions.
- ForwardedValues 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.
- LambdaFunction DistributionAssociations Ordered Cache Behavior Lambda Function Association 
- A config block that triggers a lambda function with specific actions.
- cloudfrontFunction List<DistributionAssociations Ordered Cache Behavior Function Association> 
- A config block that triggers a cloudfront function with specific actions.
- forwardedValues 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.
- lambdaFunction List<DistributionAssociations Ordered Cache Behavior Lambda Function Association> 
- A config block that triggers a lambda function with specific actions.
- cloudfrontFunction pulumiAssociations Awstypesinputcloudfront Distribution Ordered Cache Behavior Function Association[] 
- A config block that triggers a cloudfront function with specific actions.
- forwardedValues 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.
- lambdaFunction 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.
- cloudfrontFunction List<Property Map>Associations 
- A config block that triggers a cloudfront function with specific actions.
- forwardedValues 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.
- lambdaFunction 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