pulumi / pulumi-aws

An Amazon Web Services (AWS) Pulumi resource package, providing multi-language access to AWS
Apache License 2.0
461 stars 155 forks source link

aws.redshiftserverless.Workgroup config_parameters not resolved correctly #4405

Open Ownmarc opened 2 months ago

Ownmarc commented 2 months ago

Describe what happened

Workgroup with a subset of the config_parameters will cause Pulumi up to try to update the workgroup even if nothing has changed. It will then get an error because nothing changed.

Passing all the default config parameters will not cause this issue.

Sample program

This will cause an error the second time you deploy the stack if nothing else changed on the workgroup config_parameters :

redshiftserverless_namespace = aws.redshiftserverless.Namespace(
    "redshiftserverless-namespace",
    namespace_name="redshiftserverless-namespace",
    admin_username="admin",
    admin_user_password="Whatever1",
    db_name="dev",
)

redshiftserverless_workgroup = aws.redshiftserverless.Workgroup(
    "redshiftserverless-workgroup",
    workgroup_name="redshiftserverless-workgroup),
    base_capacity=8,
    config_parameters=[
        {"parameterKey": "enable_case_sensitive_identifier", "parameterValue": "true"},
    ],
    enhanced_vpc_routing=False,
    namespace_name=redshiftserverless_namespace.namespace_name,
)

This works fine :

redshiftserverless_namespace = aws.redshiftserverless.Namespace(
    "redshiftserverless-namespace",
    namespace_name="redshiftserverless-namespace",
    admin_username="admin",
    admin_user_password="Whatever1",
    db_name="dev",
)

redshiftserverless_workgroup = aws.redshiftserverless.Workgroup(
    "redshiftserverless-workgroup",
    workgroup_name="redshiftserverless-workgroup),
    base_capacity=8,
    config_parameters=[
        {"parameterKey": "auto_mv", "parameterValue": "true"},
        {"parameterKey": "datestyle", "parameterValue": "ISO, MDY"},
        {"parameterKey": "enable_case_sensitive_identifier", "parameterValue": "true"},
        {"parameterKey": "enable_user_activity_logging", "parameterValue": "true"},
        {"parameterKey": "query_group", "parameterValue": "default"},
        {"parameterKey": "require_ssl", "parameterValue": "false"},
        {"parameterKey": "search_path", "parameterValue": "$user, public"},
        {"parameterKey": "use_fips_ssl", "parameterValue": "false"},
        {"parameterKey": "max_query_execution_time", "parameterValue": "14400"},
    ],
    enhanced_vpc_routing=False,
    namespace_name=redshiftserverless_namespace.namespace_name,
)

Log output

I0826 13:29:23.073314   17180 provider_plugin.go:1871] provider received rpc error `Unknown`: `updating urn:pulumi:local::my-stack::aws:redshiftserverless/workgroup:Workgroup::redshiftserverless-workgroup: 1 error occurred:
    * updating Redshift Serverless Workgroup (redshiftserverless-workgroup): ValidationException: You didn't specify any changes to the configuration parameters.

Affected Resource(s)

No response

Output of pulumi about

CLI Version 3.129.0 Go Version go1.22.6 Go Compiler gc

Plugins KIND NAME VERSION resource aws 6.49.1 resource awsx 2.14.0 resource docker 4.5.5 language python unknown

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).

corymhall commented 2 months ago

@Ownmarc thanks for reporting the issue! It looks like this is due to an upstream bug https://github.com/hashicorp/terraform-provider-aws/issues/33899. A comment on a related PR seems to summarize what you are seeing.

...the moment you decide to specify any config parameters, you need to provide the values for ALL of the advanced controls over database...