pulumi / pulumi-aws-static-website

Apache License 2.0
11 stars 5 forks source link

Exported logsBucketName should be the bucket's name #10

Closed cnunciato closed 2 years ago

cnunciato commented 2 years ago

What happened?

Kicking the tires on this component for some template work, I noticed the output for the logs bucket is the bucket's websiteEndpoint rather than just its name. For example, given the following program:

import * as staticwebsite from "@pulumi/aws-static-website"

const site = new staticwebsite.Website("website", {
    sitePath: "./site",
    withLogs: true,
});

export const logsBucketName = site.logsBucketName;

I'd expect to be able to run pulumi up and then see the contents of the bucket using pulumi stack output:

$ aws s3 ls s3://$(pulumi stack output logsBucketName)

But because the output is using the bucket's websiteEndpoint property, that doesn't work:

$ pulumi up
...

Outputs:
    logsBucketName: "website-logs-3aad5d8.s3.amazonaws.com"

$ aws s3 ls s3://$(pulumi stack output logsBucketName)                

An error occurred (NoSuchBucket) when calling the ListObjectsV2 operation: The specified bucket does not exist

Since logs aren't generally served over HTTP, this output should probably just be the bucket's name.

Steps to reproduce

See above.

Expected Behavior

See above.

Actual Behavior

See above.

Versions used

No response

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).