Skip to content
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

Remove hard-coded AWS partitions #7175

Merged
merged 2 commits into from Jan 7, 2020
Merged

Conversation

maafk
Copy link
Contributor

@maafk maafk commented Jan 6, 2020

Also removing unused method that had hard-coded partition inside

What did you implement

  • Removed some hard-coded aws partitions to account for non-standard partitions such as aws-cn or aws-us-gov
  • Removed unused method that included a hard-coded partition

How can we verify it

Tricky to verify since would need an AWS account than can select gov-cloud or China regions, but deploy a function with ALB as event source in a gov-cloud or China region.

service: my-gov-cloud-app

provider:
  name: aws
  runtime: python3.6
  region: us-gov-west-1  # gov-cloud region

functions:
  albEventConsumer:
    handler: handler.hello
    events:
      - alb:
          # notice the partition in the ARN
          listenerArn: arn:aws-us-gov:elasticloadbalancing:us-east-1:12345:listener/app/my-load-balancer/50dc6c495c0c9188/
          priority: 1
          conditions:
            path: /hello
  myLambdaAtEdge:
    handler: myLambdaAtEdge.handler
    events:
      - cloudFront:  # not currently possible in gov-cloud, but may be soon
          eventType: viewer-response
          origin: s3://bucketname.s3.us-gov-west-1.amazonaws.com/files

Note Cloudfront isn't available for govcloud regions, but is available in China

Todos

Useful Scripts
  • npm run test:ci --> Run all validation checks on proposed changes
  • npm run lint:updated --> Lint all the updated files
  • npm run lint:fix --> Automatically fix lint problems (if possible)
  • npm run prettier-check:updated --> Check if updated files adhere to Prettier config
  • npm run prettify:updated --> Prettify all the updated files
  • Write and run all tests
  • Write documentation
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

Also removing unused method that had hard-coded partition inside
@codecov-io
Copy link

Codecov Report

Merging #7175 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7175      +/-   ##
==========================================
+ Coverage   87.94%   87.99%   +0.05%     
==========================================
  Files         236      236              
  Lines        8611     8606       -5     
==========================================
  Hits         7573     7573              
+ Misses       1038     1033       -5
Impacted Files Coverage Δ
...ins/aws/package/compile/events/cloudFront/index.js 89.83% <ø> (ø) ⬆️
lib/plugins/aws/provider/awsProvider.js 92.85% <ø> (+1.91%) ⬆️
...aws/package/compile/events/websockets/lib/stage.js 100% <ø> (ø) ⬆️
...ins/aws/package/compile/events/alb/lib/validate.js 97.26% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41d7d0b...62e9de1. Read the comment docs.

@medikoo medikoo added the bug label Jan 7, 2020
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

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

Looks great @maafk Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants