Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aws-cs-s3-folder to BucketV2 #1683

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aws-cs-s3-folder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A static website that uses [S3's website support](https://docs.aws.amazon.com/Am
Previewing update (dev):
Type Name Plan
+ pulumi:pulumi:Stack aws-cs-s3-folder-dev create
+ └─ aws:s3:Bucket my-bucket create
+ └─ aws:s3:BucketV2 my-bucket create
+ ├─ aws:s3:BucketObject index.html create
+ └─ aws:s3:BucketObject favicon.png create

Expand All @@ -36,7 +36,7 @@ A static website that uses [S3's website support](https://docs.aws.amazon.com/Am
Updating (dev):
Type Name Status
+ pulumi:pulumi:Stack aws-cs-s3-folder-dev created
+ └─ aws:s3:Bucket my-bucket created
+ └─ aws:s3:BucketV2 my-bucket created
+ ├─ aws:s3:BucketObject index.html created
+ └─ aws:s3:BucketObject favicon.png created

Expand Down
17 changes: 10 additions & 7 deletions aws-cs-s3-folder/WebsiteStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ class WebsiteStack : Stack
public WebsiteStack()
{
// Create an AWS resource (S3 Bucket)
var bucket = new Bucket("my-bucket", new BucketArgs
var bucket = new BucketV2("my-bucket", new BucketV2Args {});

var bucketWebsite = new BucketWebsiteConfigurationV2("website-config", new()
{
Website = new BucketWebsiteArgs
Bucket = bucket.Id,
IndexDocument = new BucketWebsiteConfigurationV2IndexDocumentArgs
{
IndexDocument = "index.html"
}
});
Suffix = "index.html",
},
}, new CustomResourceOptions {Parent = bucket});

var ownershipControls = new BucketOwnershipControls("ownership-controls", new()
{
Expand Down Expand Up @@ -43,13 +46,13 @@ public WebsiteStack()
var bucketObject = new BucketObject(name, new BucketObjectArgs
{
Acl = "public-read",
Bucket = bucket.BucketName,
Bucket = bucket.Bucket,
ContentType = contentType,
Source = new FileAsset(file)
}, new CustomResourceOptions {Parent = bucket, DependsOn = new Pulumi.Resource[]{ publicAccessBlock, ownershipControls }});
}

this.Endpoint = Output.Format($"http://{bucket.WebsiteEndpoint}");
this.Endpoint = Output.Format($"http://{bucketWebsite.WebsiteEndpoint}");
}

[Output] public Output<string> Endpoint { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion aws-cs-s3-folder/aws-cs-s3-folder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Pulumi" Version="3.*" />
<PackageReference Include="Pulumi.Aws" Version="6.0.2" />
<PackageReference Include="Pulumi.Aws" Version="6.*" />
</ItemGroup>

</Project>
Loading