• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

terraform apply 하면 버킷이 이미 존재 한다고 나옵니다.

21.03.15 22:18 작성 조회수 423

0

강의와 관련있는 질문을 남겨주세요.
• 강의와 관련이 없는 질문은 지식공유자가 답변하지 않을 수 있습니다. (사적 상담, 컨설팅, 과제 풀이 등)
• 질문을 남기기 전, 비슷한 내용을 질문한 수강생이 있는지 먼저 검색을 해주세요. (중복 질문을 자제해주세요.)
서비스 운영 관련 질문은 인프런 우측 하단 ‘문의하기’를 이용해주세요. (영상 재생 문제, 사이트 버그, 강의 환불 등)

질문 전달에도 요령이 필요합니다.
• 지식공유자가 질문을 좀 더 쉽게 확인할 수 있게 도와주세요.
• 강의실 페이지(/lecture) 에서 '질문하기'를 이용해주시면 질문과 연관된 수업 영상 제목이 함께 등록됩니다.
• 강의 대시보드에서 질문을 남길 경우, 관련 섹션 및 수업 제목을 기재해주세요. 
• 수업 특정 구간에 대한 질문은 꼭 영상 타임코드를 남겨주세요!

구체적인 질문일수록 명확한 답을 받을 수 있어요.
• 질문 제목은 핵심 키워드를 포함해 간결하게 적어주세요.
• 질문 내용은 자세하게 적어주시되, 지식공유자가 답변할 수 있도록 구체적으로 남겨주세요.
• 정확한 질문 내용과 함께 코드를 적어주시거나, 캡쳐 이미지를 첨부하면 더욱 좋습니다.

기본적인 예의를 지켜주세요.
• 정중한 의견 및 문의 제시, 감사 인사 등의 커뮤니케이션은 더 나은 강의를 위한 기틀이 됩니다. 
• 질문이 있을 때에는 강의를 만든 지식공유자에 대한 기본적인 예의를 꼭 지켜주세요. 
반말, 욕설, 과격한 표현 등 지식공유자를 불쾌하게 할 수 있는 내용은 스팸 처리 등 제재를 가할 수 있습니다. 

# ec2-user @ ip-172-31-46-231 in ~ [13:12:57] 

$ terraform apply

An execution plan has been generated and is shown below.

Resource actions are indicated with the following symbols:

  + create

Terraform will perform the following actions:

  # aws_s3_bucket.iyootest will be created

  + resource "aws_s3_bucket" "iyootest" {

      + acceleration_status         = (known after apply)

      + acl                         = "private"

      + arn                         = (known after apply)

      + bucket                      = "terraform101-inflearn"

      + bucket_domain_name          = (known after apply)

      + bucket_regional_domain_name = (known after apply)

      + force_destroy               = false

      + hosted_zone_id              = (known after apply)

      + id                          = (known after apply)

      + region                      = (known after apply)

      + request_payer               = (known after apply)

      + website_domain              = (known after apply)

      + website_endpoint            = (known after apply)

      + versioning {

          + enabled    = (known after apply)

          + mfa_delete = (known after apply)

        }

    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?

  Terraform will perform the actions described above.

  Only 'yes' will be accepted to approve.

  Enter a value: yes

aws_s3_bucket.iyootest: Creating...

Error: Error creating S3 bucket: BucketAlreadyExists: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.

        status code: 409, request id: VNEN48K3FK47DAGR, host id: 2Fo3jYipQ9NkBCRhVRxu01AsWDOLiCZ3ssdY3+M9jnHKOg6dyHSrCnGGkfNqVbl0tvD/LCvkH38=

  on s3bucket.tf line 1, in resource "aws_s3_bucket" "iyootest":

   1: resource "aws_s3_bucket" "iyootest" {

$ aws s3 ls

2021-03-12 06:45:52 iyoos3bucket

이름도 변경하고 다 해 봤는데 생성이 안됩니다. 왜 이럴가요 ?

답변 1

답변을 작성해보세요.

3

안녕하세요

Error message 를 보시면, 그 힌트를 얻으실 수 있습니다.

Error: Error creating S3 bucket: BucketAlreadyExists: The requested bucket name is not available. The bucket namespace is shared by all users of the system.

bucket 의 이름은 by all users of the system.

즉 모든 유저들이 공유하기 때문에, 그 이름이 유일해야합니다.

bucket                      = "terraform101-inflearn"

이 이름이 bucket 의 이름이 되고, 그 이름이 유일하지 않기 때문에,

제가 강의해서 만들었기 때문에 아마 만들어지지 않습니다.

이름을 유일할만한걸로 바꿔보시고 만들어보세요~