sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.16k stars 142 forks source link

Strange behavior when setting AWS profile in `sst.config.ts` #284

Open james-albanese opened 3 months ago

james-albanese commented 3 months ago

Version: SST ❍ ion 0.0.296

I'm attempting to set the AWS profile as follows:

export default $config({
  app(input) {
    return {
      ...
      providers: {
        aws: {
          region: "us-east-1",
          profile: "PROFILE_NAME",
        },
      },
    };
...
});

As far as I can tell, this works with the exception of ACM / Route53 related operations.

The following works fine.

new sst.aws.Router("Router", {
    ...
});

The following fails and produces the subsequent error.

new sst.aws.Router("Router", {
    domain: {
        name: "DOMAIN_NAME",
        dns: sst.aws.dns({
            zone: "HOSTED_ZONE_ID"
        })
    },
    ...
});
|  Error       AwsProvider sst:us-east-1 pulumi:providers:aws resource 'AwsProvider.sst.us-east-1' has a problem: No valid credential sources found.
Please see https://www.pulumi.com/registry/packages/aws/installation-configuration/ for more information about providing credentials.
NEW: You can use Pulumi ESC to set up dynamic credentials with AWS OIDC to ensure the correct and valid credentials are used.
Learn more: https://www.pulumi.com/registry/packages/aws/installation-configuration/#dynamically-generate-credentials
j
×  Failed
   AwsProvider sst:us-east-1
   pulumi:providers:aws resource 'AwsProvider.sst.us-east-1' has a problem: No valid credential sources found.
Please see https://www.pulumi.com/registry/packages/aws/installation-configuration/ for more information about providing credentials.
NEW: You can use Pulumi ESC to set up dynamic credentials with AWS OIDC to ensure the correct and valid credentials are used.
Learn more: https://www.pulumi.com/registry/packages/aws/installation-configuration/#dynamically-generate-credentials

The issue goes away as soon as I set the profile name in the current shell session.

export AWS_PROFILE=PROFILE_NAME
tyrong commented 2 months ago

Seeing this too after upgrading to 0.0.345