hey there, is there a way to use the --plugin opti...
# sst
m
hey there, is there a way to use the --plugin option from CDK from the SST cli?
f
Hey @Matthew Purdon, are you manually setting the
env
for a stack to a different AWS account?
Can you share how you are defining the app? And let’s see how we can add support for it.
m
yeah, I was and then I was intending to use the
cdk-credential-plugin
to deploy to a different account. https://aws.amazon.com/blogs/devops/cdk-credential-plugin/
I was setting the account using the env var CDK_DEFAULT_ACCOUNT
f
I see… so instead of using the
prod
credentials, ie.
sst deploy --profile prod
, you want to use the
services
account’s credentials and deploy into the
prod
account?
m
yeah
looks like I can do this:
Copy code
"plugin": [
    "cdk-assume-role-credential-plugin"
  ]
so I don’t need the command line, and I already had to make that change to cdk.json to add
"@aws-cdk/core:newStyleStackSynthesis": "true"
f
Sorry, I just got off a call. I was going to suggest that, you can open up
node_modules/@serverless-stack/core/index.js
and look for the
runCdkSynth
function, and above
--quite
, you can add two lines:
Copy code
"--plugin",
"cdk-assume-role-credential-plugin",
Oh i see, passing in through
cdk.json
is definitely cleaner