1. Packages
  2. AWS Classic
  3. How-to Guides
  4. 6.0 Migration Guide

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.40.0 published on Wednesday, Jun 12, 2024 by Pulumi

Migrating from 5.x to 6.x

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.40.0 published on Wednesday, Jun 12, 2024 by Pulumi

    Upstream Changes

    The upstream target has been changed from v4.67.0 to targeting v5.11.0. That means that the upstream migration guide as well as the following CHANGELOGs are relevant:

    Deprecated resources and functions

    The resources and functions listed below were renamed in a previous version. With this release, the original names have been fully deprecated. Any existing references to the original name will need to be updated.

    - const test = new aws.applicationloadbalancing.TargetGroup("test", {
    + const test = new aws.lb.TargetGroup("test", {
          port: 80,
          protocol: "HTTP",
          vpcId: main.id,
    });
    
    -  test = aws.applicationloadbalancing.TargetGroup("test",
    +  test = aws.lb.TargetGroup("test",
           port=80,
           protocol="HTTP",
           vpc_id=main.id)
    
    - "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/applicationloadbalancing"
    + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
    
    - _, err = applicationloadbalancing.NewTargetGroup(ctx, "test", &lb.TargetGroupArgs{
    + _, err = lb.NewTargetGroup(ctx, "test", &lb.TargetGroupArgs{
          Port:     pulumi.Int(80),
          Protocol: pulumi.String("HTTP"),
          VpcId:    main.ID(),
      })
    
    - var test = new Aws.ApplicationLoadBalancing.TargetGroup("test", new()
    + var test = new Aws.LB.TargetGroup("test", new()
      {
          Port = 80,
          Protocol = "HTTP",
          VpcId = main.Id,
      });
    
    - import com.pulumi.aws.applicationLoadBalancing.TargetGroup;
    + import com.pulumi.aws.lb.TargetGroup;
    
        var test = new TargetGroup("test", TargetGroupArgs.builder()
            .port(80)
            .protocol("HTTP")
            .vpcId(main.id())
            .build());
    
    - type: aws:applicationLoadBalancing:TargetGroup
    + type: aws:lb:TargetGroup
        properties:
          port: 80
          protocol: HTTP
          vpcId: ${main.id}
    

    Resources

    Functions

    Remove the deprecated AWS SDK v2 aws.sdk property (TypeScript only)

    The aws.sdk property previously provided a direct way to access the AWS SDK v2 from runtime code. The AWS SDK v2 has been deprecated by AWS, and as a result this property is being removed. The AWS SDK v3 is available to import and use directly via the various @aws-sdk/client-* libraries. See https://github.com/pulumi/pulumi-aws/pull/2584 for more details.

    import * as aws from "@pulumi/aws";
    + import * as s3sdk from "@aws-sdk/client-s3";
    
    const bucket = new aws.s3.Bucket("my-bucket");
    
     bucket.onObjectCreated("bucket-callback", async (event) => {
    -    const s3 = new aws.sdk.S3({});
    +    const s3 = new s3sdk.S3({});
         const recordFile = "lastPutFile.json";
    
         const records = event.Records || [];
         for (const record of records) {
             const key = record.s3.object.key;
             if (key !== recordFile) {
                 // Construct an event arguments object.
                 const args = {
                     key: record.s3.object.key,
                     size: record.s3.object.size,
                     eventTime: record.eventTime,
                 };
    
                 const res = await s3.putObject({
                     Bucket: bucket.id.get(),
                     Key: recordFile,
                     Body: JSON.stringify(args),
    -            }).promise();
    +            }));
             }
         }
     });
    

    WafV2 is now defined recursively

    The wafv2 module has been refactored to properly define recursive types resulting in a significant decrease in SDK size. Any references to RuleGroupRuleStatement or WebAclRuleStatement properties on a wafv2 resource, will need to be updated to use the new recursive types in the wafv2 module.

    -aws.wafv2.inputs.RuleGroupRuleStatementAndStatementStatementGeoMatchStatement
    +aws.wafv2.inputs.RuleGroupRuleStatement
    
    -pulumi_aws.wafv2.RuleGroupRuleStatementAndStatementStatementGeoMatchStatementArgs
    +pulumi_aws.wafv2.RuleGroupRuleStatementArgs
    
    -wafv2.RuleGroupRuleStatementAndStatementStatementGeoMatchStatementArgs
    +wafv2.RuleGroupRuleStatementArgs
    
    -Pulumi.Aws.WafV2.Inputs.RuleGroupRuleStatementAndStatementStatementGeoMatchStatementArgs
    +Pulumi.Aws.WafV2.Inputs.RuleGroupRuleStatementArgs
    
    -com.pulumi.aws.wafv2.inputs.RuleGroupRuleStatementAndStatementStatementGeoMatchStatementArgs
    +com.pulumi.aws.wafv2.inputs.RuleGroupRuleStatementArgs
    

    No changes are necessary.

    Unused Quicksight types have been removed

    Unused types from the quicksight module have been removed. Specifically, types that begin with AnalysisDefinition, DashboardDefinition, or TemplateDefinition. Since these were purely type definitions, you can replicate them by copying them out of the v5 SDK. We have not removed any types used by quicksight resources or functions.

    -function newDataSetReference(): aws.inputs.quicksight.TemplateSourceEntitySourceAnalysisDataSetReference { ... }
    +interface TemplateSourceEntitySourceAnalysisDataSetReference {
    +    dataSetArn: pulumi.Input<string>,
    +    dataSetPlaceholder: pulumi.Input<string>,
    +}
    +function newDataSetReference(): TemplateSourceEntitySourceAnalysisDataSetReference { ... }
    
    -args = aws.quicksight.TemplateSourceEntitySourceAnalysisDataSetReferenceArgs(data_set_arn, data_set_placeholder)
    +@pulumi.input_type
    +class TemplateSourceEntitySourceAnalysisDataSetReferenceArgs:
    +    def __init__(__self__, *,
    +                 data_set_arn: pulumi.Input[str],
    +                 data_set_placeholder: pulumi.Input[str]):
    +        """
    +        :param pulumi.Input[str] data_set_arn: Dataset Amazon Resource Name (ARN).
    +        :param pulumi.Input[str] data_set_placeholder: Dataset placeholder.
    +        """
    +        pulumi.set(__self__, "data_set_arn", data_set_arn)
    +        pulumi.set(__self__, "data_set_placeholder", data_set_placeholder)
    +
    +    @property
    +    @pulumi.getter(name="dataSetArn")
    +    def data_set_arn(self) -> pulumi.Input[str]:
    +        """
    +        Dataset Amazon Resource Name (ARN).
    +        """
    +        return pulumi.get(self, "data_set_arn")
    +
    +    @data_set_arn.setter
    +    def data_set_arn(self, value: pulumi.Input[str]):
    +        pulumi.set(self, "data_set_arn", value)
    +
    +    @property
    +    @pulumi.getter(name="dataSetPlaceholder")
    +    def data_set_placeholder(self) -> pulumi.Input[str]:
    +        """
    +        Dataset placeholder.
    +        """
    +        return pulumi.get(self, "data_set_placeholder")
    +
    +    @data_set_placeholder.setter
    +    def data_set_placeholder(self, value: pulumi.Input[str]):
    +        pulumi.set(self, "data_set_placeholder", value)
    +
    +args = TemplateSourceEntitySourceAnalysisDataSetReferenceArgs(data_set_arn, data_set_placeholder)
    
    -var args quicksight.TemplateSourceEntitySourceAnalysisDataSetReferenceArgs
    +type TemplateSourceEntitySourceAnalysisDataSetReferenceArgs struct {
    +	// Dataset Amazon Resource Name (ARN).
    +	DataSetArn pulumi.StringInput `pulumi:"dataSetArn"`
    +	// Dataset placeholder.
    +	DataSetPlaceholder pulumi.StringInput `pulumi:"dataSetPlaceholder"`
    +}
    +
    +var args TemplateSourceEntitySourceAnalysisDataSetReferenceArgs
    
    -var args Pulumi.Aws.Quicksight.Inputs.TemplateSourceEntitySourceAnalysisDataSetReferenceArgs;
    +public sealed class TemplateSourceEntitySourceAnalysisDataSetReferenceArgs : global::Pulumi.ResourceArgs
    +{
    +    /// <summary>
    +    /// Dataset Amazon Resource Name (ARN).
    +    /// </summary>
    +    [Input("dataSetArn", required: true)]
    +    public Input<string> DataSetArn { get; set; } = null!;
    +
    +    /// <summary>
    +    /// Dataset placeholder.
    +    /// </summary>
    +    [Input("dataSetPlaceholder", required: true)]
    +    public Input<string> DataSetPlaceholder { get; set; } = null!;
    +
    +    public TemplateSourceEntitySourceAnalysisDataSetReferenceArgs()
    +    {
    +    }
    +    public static new TemplateSourceEntitySourceAnalysisDataSetReferenceArgs Empty => new +TemplateSourceEntitySourceAnalysisDataSetReferenceArgs();
    +}
    +var args TemplateSourceEntitySourceAnalysisDataSetReferenceArgs;
    
    -private com.pulumi.aws.quicksight.inputs.TemplateSourceEntitySourceAnalysisDataSetReferenceArgs;
    +/*
    + * Copy in this file:
    + * https://github.com/pulumi/pulumi-aws/blob/v5.42.0/sdk/java/src/main/java/com/pulumi/aws/quicksight/inputs/TemplateSourceEntitySourceAnalysisDataSetReferenceArgs.java 
    + */
    + private TemplateSourceEntitySourceAnalysisDataSetReferenceArgs;
    

    Pulumi YAML is structurally typed, so you don’t need to make any changes.

    Property name of organizations/getOrganizationalUnits resource changed from childrens to children

    The name of property aws:organizations/getOrganizationalUnits:getOrganizationalUnits has changed from childrens to children and the name of the associated type from children to child. The name change is because children is itself already plural and it’s natural singular is child. See https://github.com/pulumi/pulumi-aws/pull/2634 for details.

     const units = aws.organizations.getOrganizationalUnitsOutput({
         parentId: "SomeId",
     });
    -export const children = units.apply(units => units.childrens);
    +export const children = units.apply(units => units.children);
    
     units = aws.organizations.get_organizational_units_output(parent_id="SomeId")
    -pulumi.export("children", units.childrens)
    +pulumi.export("children", units.children)
    
     units := originizations.GetOrganizationalUnitsOutput(&originizations.GetOrganizationalUnitsOutputArgs{
         ParentId: pulumi.String("SomeId"),
     })
    -pulumi.Export("children", units.Childrens)
    +pulumi.Export("children", units.Children)
    
     var units = Aws.Organizations.GetOrganizationalUnits.Invoke(new()
     {
         ParentId = "SomeId",
     });
    
     return new Dictionary<string, object?>
     {
    -    ["children"] = units.Apply(getOrganizationalUnitsResult => getOrganizationalUnitsResult.Childrens),
    +    ["children"] = units.Apply(getOrganizationalUnitsResult => getOrganizationalUnitsResult.Children),
     }
    
     OrganizationsFunctions.getOrganizationalUnits(GetOrganizationalUnitsArgs.builder()
                 .parentId("SomeId")
                 .build())
    -            .Childrens()
    +            .Children()
    
     variables:
       units:
         fn::aws:organizations:getOrganizationalUnits:
           parentId: "SomeId"
     outputs:
    -    children: ${units.childrens}
    +    children: ${units.children}
    

    Function signature change

    For three functions, the signature has changed to accommodate a new argument. The new argument is optional, so passing an empty argument block is sufficient. Any reference to these three functions will need to be updated. The three impacted functions are:

    • aws:index/getBillingServiceAccount:getBillingServiceAccount
    • aws:index/getCallerIdentity:getCallerIdentity
    • aws:index/getPartition:getPartition
    -`(pulumi.InvokeOptions) -> T`
    + `(Args, pulumi.InvokeOptions) -> T`
    
    -const result = getBillingServiceAccount(invokeOptions);
    +const result = getBillingServiceAccount({ id }, invokeOptions);
    
    -const result = getCallerIdentity(invokeOptions);
    +const result = getCallerIdentity({ id }, invokeOptions);
    
    +const result = getPartition(invokeOptions);
    +const result = getPartition({ id }, invokeOptions);
    
    -result = get_billing_service_account(opts)
    +result = get_billing_service_account(id, opts)
    
    -result = get_caller_identity(opts)
    +result = get_caller_identity(id, opts)
    
    +result = get_partition(opts)
    +result = get_partition(id, invokeOptions)
    
    -result, err := aws.GetBillingServiceAccount(ctx, opts)
    +result, err := aws.GetBillingServiceAccount(ctx, &aws.GetBillingServiceAccountArgs{
    +    Id: id,
    +}, opts)
    
    -result, err := aws.GetCallerIdentity(ctx, opts)
    +result, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{
    +    Id: id,
    +}, opts)
    
    -result, err := aws.GetPartition(ctx, opts)
    +result, err := aws.GetPartition(ctx, &aws.GetPartitionArgs{
    +    Id: id,
    +}, opts)
    
    -var result = Aws.GetBillingServiceAccount.Invoke(opts);
    +var result = Aws.GetBillingServiceAccount.Invoke(args, opts);
    
    -var result = Aws.GetCallerIdentity.Invoke(opts);
    +var result = Aws.GetCallerIdentity.Invoke(args, opts);
    
    -var result = Aws.GetPartition.Invoke(opts);
    +var result = Aws.GetPartition.Invoke(args, opts);
    
    -final var result AwsFunctions.getBillingServiceAccount(opts);
    +final var result AwsFunctions.getBillingServiceAccount(args, opts);
    
    -final var result AwsFunctions.getCallerIdentity(opts);
    +final var result AwsFunctions.getCallerIdentity(args, opts);
    
    -final var result AwsFunctions.getPartition(opts);
    +final var result AwsFunctions.getPartition(args, opts);
    

    You may continue to use your existing code in Pulumi YAML.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.40.0 published on Wednesday, Jun 12, 2024 by Pulumi