1
0

Reminder record 1: AWS

Posted at

Amplify Gen 2 ( Amplify ) でアプリを構築中に学んだことを残す。

RDS の Credentials の取得

  • 原因
    • Database の Credentials を動的に生成する場合、Secret Manager から取得して、Database URL を生成する必要がある。
  • 対処
    • ECS のタスク実行ロールで、自前で生成した SecretsManager を読み取る。 1

The maximum number of VPCs has been reached.

  • 原因
    • quota 2
    • Google Cloud にもあると思うが、警告された記憶がない。
CloudFormationDeploymentError: The CloudFormation deployment has failed.
Resolution: Find more information in the CloudFormation AWS Console for this stack.
Cause: ❌ Deployment failed: Error: The stack named amplify-zzzzzzzzzzzzzzz-hoge464-branch-9999999999 failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The maximum number of VPCs has been reached. (Service: Ec2, Status Code: 400, Request ID: 9e18c0c5-4744-46de-b19f-42eacc4d74f5)" (RequestToken: b6f61210-ecc2-54d7-fba1-1c23284f4608, HandlerErrorCode: GeneralServiceException), Embedded stack arn:aws:cloudformation:ap-northeast-1:000000000000:stack/amplify-zzzzzzzzzzzzzzz-hoge464-branch-9999999999-fugaCustomResourcesF3BA9C19-1UGIK5IOKLCC6/0f57f6d0-3e7a-11ef-bfcf-066d2b45ed53 was not successfully created: The following resource(s) failed to create: [fugaAmpxVPCC6A56BA2]. 

exec /usr/local/bin/docker-entrypoint.sh: exec format error

  • 原因
    • ローカルで sandbox を起動した。 npx ampx sandbox --profile ${MY_PROFILE_NAME} --identifier xxxx 3 4
    • Mac で docker build を行ったため。
  • 対処
    • CPU Architecture、OS を定義する。
const taskDefinition = new ecs.FargateTaskDefinition(
  customResourceStack,
  'FargateTaskDefinition',
  {
    memoryLimitMiB: 512,
    cpu: 256,
    runtimePlatform: {
      cpuArchitecture: ecs.CpuArchitecture.X86_64,              // add
      operatingSystemFamily: ecs.OperatingSystemFamily.LINUX,   // add
    },
  },
);

Conclusion

悩みが尽きることはない。

  1. https://zenn.dev/akira_abe/articles/20220220-aws-cdk-fargate#%E8%AA%B2%E9%A1%8C2.%E3%81%AE%E8%A7%A3%E6%B1%BA

  2. https://docs.aws.amazon.com/ja_jp/vpc/latest/userguide/amazon-vpc-limits.html

  3. https://entreprogrammer.jp/exec-format-error-m1-mac/

  4. https://zenn.dev/fdnsy/articles/a7be6e205a39d0#platform

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0