Skip to content

Use Moto account ID resolver #6104

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

Merged
merged 34 commits into from
Jun 17, 2022
Merged

Use Moto account ID resolver #6104

merged 34 commits into from
Jun 17, 2022

Conversation

viren-nadkarni
Copy link
Member

@viren-nadkarni viren-nadkarni commented May 20, 2022

Summary

  • Replace all references to Account ID with Moto resolver introduced in add indirection to access account id getmoto/moto#5098
  • Use subscripting to retrieve Moto backend from BackendDict so that a new backend is created for the given region if it doesn't exist
  • Change internal call detection logic to make use of a newly introduced header. Previously we relied on a special value for AWS_ACCESS_KEY_ID. With the multi-accounts revamp, AWS_ACCESS_KEY_ID must always be set to the Account ID

Tests

CI pipeline against the ext branch: https://github.com/localstack/localstack/actions/runs/2429784539

@github-actions github-actions bot added size/m aws:apigateway Amazon API Gateway aws:cloudformation AWS CloudFormation aws:firehose Amazon Data Firehose aws:kms AWS Key Management Service aws:lambda AWS Lambda aws:logs AWS CloudWatch Logs aws:sns Amazon Simple Notification Service aws:stepfunctions AWS Step Functions labels May 20, 2022
@viren-nadkarni viren-nadkarni added refactoring and removed aws:cloudformation AWS CloudFormation aws:apigateway Amazon API Gateway aws:lambda AWS Lambda aws:firehose Amazon Data Firehose aws:kms AWS Key Management Service aws:stepfunctions AWS Step Functions aws:sns Amazon Simple Notification Service aws:logs AWS CloudWatch Logs labels May 20, 2022
@github-actions github-actions bot added aws:apigateway Amazon API Gateway aws:cloudformation AWS CloudFormation aws:firehose Amazon Data Firehose aws:iam AWS Identity and Access Management aws:kms AWS Key Management Service aws:lambda AWS Lambda aws:logs AWS CloudWatch Logs aws:sns Amazon Simple Notification Service aws:sqs Amazon Simple Queue Service aws:stepfunctions AWS Step Functions aws:ec2 Amazon Elastic Compute Cloud labels May 20, 2022
@viren-nadkarni viren-nadkarni temporarily deployed to localstack-ext-tests June 15, 2022 10:34 Inactive
@viren-nadkarni viren-nadkarni requested a review from thrau June 15, 2022 12:17
Copy link
Member

@thrau thrau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very clean now @viren-nadkarni, great job!

Just one minor nit: it would be great if we could move accounts.py into localstack.aws and also move the newly introduced hook for patching moto into accounts.py.

@viren-nadkarni viren-nadkarni requested a review from dfangl June 16, 2022 10:02
@viren-nadkarni viren-nadkarni merged commit 6319ecc into v1 Jun 17, 2022
@viren-nadkarni viren-nadkarni deleted the multi-account-pro branch June 17, 2022 13:18
@github-actions github-actions bot locked and limited conversation to collaborators Jun 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws:apigateway Amazon API Gateway aws:cloudformation AWS CloudFormation aws:cloudwatch Amazon CloudWatch aws:ec2 Amazon Elastic Compute Cloud aws:firehose Amazon Data Firehose aws:iam AWS Identity and Access Management aws:kms AWS Key Management Service aws:lambda AWS Lambda aws:logs AWS CloudWatch Logs aws:sns Amazon Simple Notification Service aws:sqs Amazon Simple Queue Service aws:stepfunctions AWS Step Functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants