0
0

More than 1 year has passed since last update.

AWS 関連メモ

Last updated at Posted at 2022-08-24

##NextアプリのcircleCiで自動デプロイ

s3の設定

①bucket作成

  • 静的ホスティング有効化
  • ACL許可設定
  • policy追加 例↓
{
    "Version": "2012-10-17",
    "Id": "Policy1661675250164",
    "Statement": [
        {
            "Sid": "Stmt1661675247450",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::BUCKET名/*"
        },
        {
            "Sid": "Stmt1661677462962",
            "Effect": "Allow",
            "Principal": {
                "AWS": "ユーザーARN"
            },
            "Action": "s3:PutObject",
            "Resource": "arn:aws:s3:::BUCKET名/*"
        }
    ]
}
circleCi設定
  • 環境変数の追加
AWS_ACCESS_KEY_ID: ユーザのAWSアクセスキー
AWS_SECRET_ACCESS_KEY: ユーザのAWSシークレットキー
AWS_DEFAULT_REGION: デフォルトリージョン
AWS_S3_BUCKET_NAME: バケット名
buildに失敗する場合
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

package.json
    "build": "CI=false && react-scripts build",

https対応した独自ドメインのWebサイトをS3 + CloudFrontで運用する手順

Amazon Route 53 がパブリックホストゾーンに作成する NS レコードと SOA レコード

0
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
0
0