Skip to content

13.3. アプリケーションのデプロイの実行エラーについて #51

@kakukeko

Description

@kakukeko

13.3. アプリケーションのデプロイにて cdk deploy を実行すると下記のエラーが発生しました。

Stack Deployments Failed: Error: The stack named Bashoutter failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: API: s3:PutBucketPolicy Access Denied

2023 年 4 月からS3 パブリックアクセスブロック設定はすべて有効になったようなので、
Amazon S3 ストレージへのパブリックアクセスのブロック

app.pyの下記部分を

        # <2>
        bucket = s3.Bucket(
            self, "Bashoutter-Bucket",
            website_index_document="index.html",
            public_read_access=True,
            auto_delete_objects=True,
            removal_policy=core.RemovalPolicy.DESTROY
        )

下記へ変更し実行すると、エラーなくハンズオンを進めることができました。

        # <2>
        bucket = s3.Bucket(
            self, "Bashoutter-Bucket",
            website_index_document="index.html",
            public_read_access=True,
            auto_delete_objects=True,
            removal_policy=core.RemovalPolicy.DESTROY,
            block_public_access=s3.BlockPublicAccess(
                block_public_policy=False
                )
        )

これで良いのか不明です。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions