-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the ability to specify --accountid parameter on the command line #6568
Conversation
This parameter is then used during the substitution of parameters in the CloudFormation template to replace ${AWS::AccountId} rather than using a hardcoded default (123456789012) This is useful, for example, when running `sam local invoke` on a Lambda function, where the account id is not hardcoded into the CFN template in Layer references Tests have also been updated to expect the accountid parameter
Hi @defenderkev, thanks for opening a PR. I consulted with the team and we agreed to read the |
Certainly. Once I commit the update, will that notify you or do I need to bump the PR somehow? |
You can notify us once the PR is ready for review and we can take a look. |
Can you confirm which file you're referring to? The only place I can see where the AWS CLI stores the account id is in the |
Hi @defenderkev, apologies for the late reply. You are right, account_id is not defined in the config file except when using SSO credentials. I was thinking in the sense that the credentials in that file could be used to create a sts boto3 client to retrieve the account_id. An alternate solution could also be to define the account_id as a parameter and read the provided |
Hi @defenderkev, just checking in if the above suggestions make sense to you. Are you still willing to continue contributions on this PR? |
Sorry, work has been crazy recently. I'm still willing to continue with
this, but I just haven't had time to review your suggestions yet. I hope to
get some time in the next couple of weeks
…On Thu, Feb 29, 2024 at 6:25 AM Haresh Nasit ***@***.***> wrote:
Hi @defenderkev <https://github.com/defenderkev>, just checking in if the
above suggestions make sense to you. Are you still willing to continue
contributions on this PR?
—
Reply to this email directly, view it on GitHub
<#6568 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BAMIXGDB7YO4RTGLUQAZGCDYWANMJAVCNFSM6AAAAABB66I3KOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZQGQ4DQMJRGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I'm going to convert this PR to draft for now since it is still being worked on, but not actively. Let us know if there is anything you need on our end to help push this forward. |
Hey @defenderkev, closing your PR for now since there's no activity. You can still work on the PR to address the comments. And feel free to re-open the PR once it's ready for review. Thanks! |
Which issue(s) does this change fix?
#2325
Why is this change necessary?
Because currently if you have !Sub xxx
${AWS::AccountId}
xxx in, for example, a layer definition, SAM uses a default substitution which doesn't reference the correct Account IDHow does it address the issue?
It adds the ability to specify a command line option( --accountid ). This parameter is then used during the substitution of parameters in the CloudFormation template to replace ${AWS::AccountId} rather than using a hardcoded default (123456789012)
What side effects does this change have?
None that I can see
Mandatory Checklist
PRs will only be reviewed after checklist is complete
make pr
passesmake update-reproducible-reqs
if dependencies were changed- parameter description added to 'AWS Credential Options' section for --help
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.