Publishes a bucket folder as a website on CloudFront, with an optional custom domain. Comes with the setup; publishing needs Standard or Ultra.
- Creates
- One role, and one small Lambda function, with its own role, that is the only thing allowed to change bucket policies. Each site you publish then gets a CloudFront distribution, an origin access control and a CloudFront function, plus an ACM certificate when you add a domain.
- Main read actions
cloudformation:DescribeStacks (this stack), s3:ListAllMyBuckets, s3:GetBucketLocation, s3:ListBucket, s3:GetEncryptionConfiguration, route53:ListHostedZones, ListHostedZonesByName, ListResourceRecordSets, GetChange, route53domains:ListPrices, GetDomainSuggestions, GetOperationDetail, cloudfront:GetDistribution, GetDistributionConfig, DescribeFunction, GetOriginAccessControl, acm:DescribeCertificate- Change actions
lambda:InvokeFunction (its policy function), cloudfront:CreateDistribution, TagResource, UpdateDistribution, DeleteDistribution, CreateInvalidation, cloudfront:CreateFunction, PublishFunction, DeleteFunction, cloudfront:CreateOriginAccessControl, DeleteOriginAccessControl, acm:RequestCertificate, AddTagsToCertificate, DeleteCertificate, route53:ChangeResourceRecordSets (A, AAAA and CNAME), route53domains:CheckDomainAvailability, route53domains:RegisterDomain (only if an admin turns on buying domains), Policy function’s own role: s3:GetBucketPolicy, PutBucketPolicy, DeleteBucketPolicy (buckets in scope), cloudfront:ListTagsForResource- Reach
- Bucket reads and the policy function cover every bucket in the account; the function only adds or removes one statement letting one site’s distribution read one folder, and keeps every other statement. Distributions and certificates are created with a bucketdesk:site tag, and IAM lets the role change or delete only ones carrying it; BucketDesk only changes the ones it created, but IAM alone does not stop the role tagging others first. Origin access controls are not scoped, so any unused one in the account could be deleted. CloudFront functions are limited to bucketdesk-site-* names. Bucket names and regions are listed account-wide, and every hosted zone’s records can be read and their A, AAAA and CNAME records changed. Buying domains through BucketDesk is not available yet: the stack adds route53domains:RegisterDomain only if an admin switches on “Buy domains in BucketDesk”, off by default, and the price and suggestion reads are unused for now. Change permissions are used only to publish, add or remove a domain, clear a site’s cache after files change, or unpublish.
- What BucketDesk receives
- Each site’s bucket, folder, domain, status and the IDs of its distribution, certificate and hosted zone, plus the DNS records to show you. File names are read live when you publish, to count the folder and check for an index.html, and are not stored.
- To remove
- Unpublish each site on the Websites page, which deletes its distribution, function, origin access control and certificate, the DNS records BucketDesk wrote and its bucket policy statement, before you delete the stack. Your domains, hosted zones and any records you added at another DNS provider stay.