Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

139
Visualizações
Create Multiple S3 Buckets having same properties with cloudformation

I'm trying to create multiple S3 bucktes with same propeties.But I'm not able to create multiple s3 buckets.

I found in http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html if you have multiple resources of the same type, you can declare them together by separating them with commas

But I didn't find any example and I'm not sure how to do it.I tried debugging but not getting the result. Please suggest. Below is my yaml file:

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  myS3Bucketlo:
    Type: AWS::S3::Bucket
    Properties:
      AccessControl: AuthenticatedRead
Outputs:
  WebsiteURL:
    Value: !GetAtt myS3Bucketlo.WebsiteURL
    Description: URL for the website hosted on S3
about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

In a CloudFormation template, each resource must be declared separately. So, even if your buckets have identical properties, they still must be individually declared:

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  bucket1:
    Type: AWS::S3::Bucket
    Properties:
      AccessControl: AuthenticatedRead
  bucket2:
    Type: AWS::S3::Bucket
    Properties:
      AccessControl: AuthenticatedRead
  bucket3:
    Type: AWS::S3::Bucket
    Properties:
      AccessControl: AuthenticatedRead
Outputs:
  WebsiteURL1:
    Value: !GetAtt bucket1.WebsiteURL
    Description: URL for the website 1 hosted on S3
  WebsiteURL2:
    Value: !GetAtt bucket2.WebsiteURL
    Description: URL for the website 2 hosted on S3
  WebsiteURL3:
    Value: !GetAtt bucket3.WebsiteURL
    Description: URL for the website 3 hosted on S3

However,

You must declare each resource separately; however, if you have multiple resources of the same type, you can declare them together by separating them with commas.

The wording of this text does imply there is a shortcut to avoid duplication, but I have never seen such a working example.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda