

Announcing v5.0.0 of the Pulumi AWS Provider
source link: https://www.pulumi.com/blog/announcing-v5.0.0-of-the-pulumi-aws-provider/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Announcing v5.0.0 of the Pulumi AWS Provider
Posted on Monday, Mar 28, 2022
We are excited to announce v5.0.0 of the Pulumi AWS Classic provider. The AWS Classic provider is one of the most heavily used providers across the Pulumi ecosystem, and offers access to the full surface area of the upstream Terraform AWS Provider from within Pulumi projects in all supported Pulumi languages. The v5.0.0 release brings a substantial set of fixes and improvements to the provider, including a number of breaking changes as part of the major version release.
At Pulumi, we take compatibility seriously, and are concious of the impact that major version updates can have on developer adoption. To that end, it is always our goal to minimize the extent of breaking changes where possible, and to provide easy paths for adoption of new versions. Among the breaking changes that come along with the upstream provider update, one in particular has potential to be disruptive to common usage of the Pulumi AWS Classic provider - a change to the API for the AWS S3 Bucket resource which removes many features from the Bucket resource and introduces new resources to represent these capabilities.
In order to ensure that Pulumi AWS Classic users are not adversely impacted by this breaking change, we have extended the Pulumi AWS Classic provider to offer both the old implementation and the new implementation of the S3 Bucket resource. This means that all existing usages of S3 Bucket will continue to work as normal. We also now offer the ability to create a v2 variants of the S3 Bucket supported in the new upstream AWS provider.
Let’s consider an existing implemention of an S3 Bucket that is used to create a static website:
import * as aws from "@pulumi/aws";
const siteBucket = new aws.s3.Bucket("s3-website-bucket", {
website: {
indexDocument: "index.html",
},
});
In the upstream provider, the S3 Bucket resource has been broken into multiple pieces meaning that you would need to move the website part of the bucket out to be it’s own resource. We have ensured that this will continue to work in Pulumi.
What if I want to migrate to use the new implementation of an S3 Bucket?
The Pulumi AWS Provider, has introduced a new resource, aws.s3.BucketV2
that users can use to create new variants of
how an S3 bucket resource would look. To create a static website using BucketV2
, we can see that the code gets more
targetted toward the resource that we are writing:
import * as aws from "@pulumi/aws";
const siteBucket = new aws.s3.BucketV2("s3-website-bucket");
const bucketWebsiteConfig = new aws.s3.BucketWebsiteConfigurationV2("website-config", {
bucket: siteBucket.bucket,
indexDocument: {
suffix: "index.html"
},
});
Can I migrate from aws.s3.Bucket
to aws.s3.BucketV2
?
Yes! As part of this major version, we have taken advantage of using aliases in Pulumi to be able to allow users to
change to aws.s3.BucketV2
easily. An alias was added to the new aws.s3.BucketV2
resource as follows:
"aws_s3_bucket": {
Tok: awsResource(s3Mod, "BucketV2"),
Aliases: []tfbridge.AliasInfo{
{
Type: stringRef("aws:s3/bucket:Bucket"),
},
},
},
This ensures that when a user changes from aws.s3.Bucket
to aws.s3.BucketV2
that the Pulumi engine understands that
the bucket is not a new bucket but is an existing bucket that has changed. Therefore, the Pulumi engine will not destroy
the bucket and recreate it. This means that to change from 1 codebase to the other, we just need to keep the names of the
resources the same (e.g s3-website-bucket
in the code above) and then continue to add the new code to satisfy the way the
resources need to be handed (e.g. BucketWebsiteConfigurationV2
in the code above).
You can see the steps on how this works as follows:
Notice that the bucket is not recreate - the only change is the addition of the new aws s3 resource for the website configuration. Your existing infrastructure is not going to change and thus we can easily migrate between the different resource types.
Get Started Today!
You can browse our API reference docs with inline examples or explore the Pulumi AWS SDKs repository to get started today!
Recommend
-
11
初探 Pulumi 上傳靜態網站到 AWS S3 (二) 上一篇『初探 Pulumi 上傳靜態網站到 AWS S3 (一)』主要介紹 Pulumi 基本使用方式,而本篇會延續上...
-
13
初探 Pulumi 上傳靜態網站到 AWS S3 (一) 上一篇作者提到了兩套 Infrastructure as Code 工具,分別是 Terraform 跟
-
3
Announcing the Pulumi REST APIPosted on Monday, Sep 20, 2021Pulumi was designed to be highly extensible from the outset. That includes core languages and cloud provide...
-
10
Announcing the Pulumi AWS Native ProviderPosted on Thursday, Sep 30, 2021We are excited to announce the release of the new
-
9
Infrastructure as Code on AWS using Go and Pulumi When we talk about Infrastructure as Code or IaC, the first tool that comes to min...
-
7
Pulumi Announces AWS Native Provider Nov 17, 2021 2 min...
-
7
Using AWS Quick Starts with the Pulumi RegistryPosted on Wednesday, Jan 5, 2022As somebody who works on AWS projects across numerous projects, teams, and indus...
-
4
AWS Enterprise Container Management with PulumiPosted on Thursday, Apr 14, 2022Managing containers and Kubernetes clusters are consistently popular topic areas on the Pulumi blog and in our docs. Our customers regularly cite t...
-
7
Announcing Infrastructure as Code with Java and PulumiPosted on Wednesday, May 4, 2022Today we are excited to announce the preview of Java support for all of your modern infrastructure as code needs. This anno...
-
7
Pulumi Docker Provider 4.0: Build Images Up To 50x FasterPosted on Wednesday, Mar 8, 2023The Pulumi Docker Provider has been a top Pulumi pr...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK