Skip to content

Commit

Permalink
Update cloudfront docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjjung committed Feb 11, 2025
1 parent 96fc87d commit 5773a6c
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions tb_pulumi/cloudfront.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@
class CloudFrontS3Service(tb_pulumi.ThunderbirdComponentResource):
"""Serve the static contents of an S3 bucket over a CloudFront Distribution.
Produces the following ``resources``:
- *service_bucket* - `aws.s3.Bucket <https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucket/>`_ in which to
store the static content to be served over the CloudFront Distribution.
- *logging_bucket* - `aws.s3.Bucket <https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucket/>`_ in which to
store the access logs for the service bucket.
- *logging_bucket_ownership* - `aws.s3.BucketOwnershipControls
<https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucketownershipcontrols/>`_ which allow CloudFront to
upload logs into the logging bucket.
- *logging_bucket_acl* - `aws.s3.BucketAclV2
<https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucketaclv2/>`_ allowing CloudFront to control the
logging bucket via the AWS account's canonical user.
- *origin_access_control* - `aws.cloudfront.OriginAccessControl
<https://www.pulumi.com/registry/packages/aws/api-docs/cloudfront/originaccesscontrol/>`_ allowing the CloudFront
Distribution to service the service bucket's content via CDN.
- *cloudfront_distribution* - `aws.cloudfront.Distribution
<https://www.pulumi.com/registry/packages/aws/api-docs/cloudfront/distribution/>`_ that serves the service bucket
content over a CDN and produces output logs in the logging bucket.
- *service_bucket_policy* - `aws.s3.BucketPolicy
<https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucketpolicy/>`_ allowing the CloudFront Distribution
read access to the objects in the service bucket.
- *invalidation_policy* - `aws.iam.Policy <https://www.pulumi.com/registry/packages/aws/api-docs/iam/policy/>`_
that allows an IAM entity to create cache invalidations in the CloudFront Distribution, which must be done when
the contents of the service bucket are updated.
:param name: A string identifying this set of resources.
:type name: str
Expand Down Expand Up @@ -233,11 +258,6 @@ def __init__(
)

self.finish(
outputs={
'service_bucket': service_bucket.id,
'logging_bucket': logging_bucket.id,
'cloudfront_domain': cloudfront_distribution.domain_name,
},
resources={
'service_bucket': service_bucket,
'logging_bucket': logging_bucket,
Expand Down

0 comments on commit 5773a6c

Please sign in to comment.