pulumi / examples

Infrastructure, containers, and serverless apps to AWS, Azure, GCP, and Kubernetes... all deployed with Pulumi
https://www.pulumi.com
Apache License 2.0
2.36k stars 877 forks source link

Random password generation includes forbidden characters #1392

Open garysassano opened 1 year ago

garysassano commented 1 year ago

What happened?

  aws:rds:Instance (mock-wp-be-rds):
    error: 1 error occurred:
        * creating RDS DB Instance (mock-wp-be-rds29c843a): InvalidParameterValue: The parameter MasterUserPassword is not a valid password. Only printable ASCII characters besides '/', '@', '"', ' ' may be used.
        status code: 400, request id: 497a0cda-ebcf-43d1-ac7f-8ead16c772e3

Expected Behavior

     Type                          Name                 Plan       
     pulumi:pulumi:Stack           mock-wp-dev                     
     ├─ custom:resource:Backend    mock-wp-be                      
 +   │  └─ aws:rds:Instance        mock-wp-be-rds       create     

Steps to reproduce

This code can generate random passwords with characters that are not accepted by RDS MasterUserPassword parameter:

# Get secretified password from config and protect it going forward, or create one using the 'random' provider.
db_password=config.get_secret('db_password')
if not db_password:
    password=random.RandomPassword('db_password',
        length=16,
        special=True,
        override_special='_%@',
        )
    # Pulumi knows this provider is used to create a password and thus automatically protects it going forward.
    db_password=password.result

Output of pulumi about

.

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