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

[SAM] Review templates and find points to replace with Mappings data #23

Closed
Tracked by #24
binchoo opened this issue Sep 1, 2022 · 1 comment
Closed
Tracked by #24

Comments

@binchoo
Copy link
Owner

binchoo commented Sep 1, 2022

To-be:
The overall goal is to find an elegant way to provide test/prod environments to the PaimonGanyu's architecture.

  • Have two different AWS accounts per test/prod environment.
  • The Mappings area isn't currently in use. Review and find some points that mapping data can replace.
  • Consider using Lambda alias to provide test/prod environments for the workflows in the paimonganyu stack. Two siloed accounts will separate the environments.
@binchoo binchoo self-assigned this Sep 1, 2022
@binchoo binchoo added this to the release 1.0.5 milestone Sep 1, 2022
@binchoo binchoo mentioned this issue Sep 4, 2022
2 tasks
binchoo added a commit that referenced this issue Sep 4, 2022
@binchoo
Copy link
Owner Author

binchoo commented Sep 4, 2022

Change of Impact

New DNS Hosted Zone

  • I acquired a new domain name for PaimonGanyu: paimon.studio. Its name was considered for future business.

New AWS Account for Test Environment

  • PaimonGanyu is manged by two AWS accounts per environment(test/prod).
    • Test environment manger - paimonganyu-test:pgtest
    • Production environment manager - jbinchoo-aws:pgprod

Third-Level Domain for Test Environment in the New Account

  • The new account paimonganyu-test created a Route 53 Hosted Zone - test.paimon.studio. It manages DNS records for instances in the test environment.
  • To resolve (*.)test.paimon.studio domain names, jbinchoo-aws created an NS record within its paimon.studio hosted zone, which will propagate DNS requests to the name servers that paimonganyu-test account has.

Mappings and Conditions with CFN templates

Parameters:
  Env:
    Type: String
    Default: test
    AllowedValues:
      - test
      - prod
    Description: The enviroment type of this deployment.

  UseALB:
    Type: String
    Default: 'False'
    AllowedValues:
      - 'True'
      - 'False'
    Description: Whether to create an ALB. If Env=prod, an ALB is always created.

Conditions:
  CreateProd: !Equals [!Ref Env, prod]
  CreateALB: !Or [Condition: CreateProd, !Equals [!Ref UseALB, 'True']]

Mappings:
  EnvMap:
    HostedZone:
      prod: paimon.studio.
      test: test.paimon.studio.
    ApiDomain:
      prod: skill.paimon.studio
      test: skill.test.paimon.studio

  RegionEnvMap:
    ap-northeast-2:
      prod: SeoulProd
      test: SeoulTest
    ap-northeast-1:
      prod: TokyoProd
      test: TokyoTest
    CACert:
      SeoulProd: arn:aws:acm:ap-northeast-2:305992497901:certificate/9023abac-1279-4647-8056-ec5be058af4c
      SeoulTest: arn:aws:acm:ap-northeast-2:254804608366:certificate/3ee23337-94cb-47ba-9ce4-b91c0b71ac1b
      TokyoProd: arn:aws:acm:ap-northeast-1:305992497901:certificate/eb2ba354-e8c3-49ec-836d-5003be9c0da7

CFN Template Locations

CFN templates for paimonganyu and paimonganyu-skill stacks exist inside their own gradle project's root directory.

Gradle Tasks Cares SAM Build & Deploy

Gradle tasks take responsibility to execute sam build & deploy CLI commands.

@binchoo binchoo closed this as completed Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant