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

440
Visualizações
How to enable request metrics for S3 bucket using Cloudformation or CDK

I am able to enable (request metrics for S3 bucket, apid option) in the AWS console manually by checking the checkbox(https://ibb.co/bWDLcNT). But I am trying to do that via code. I tried finding solutions that uses CloudFormation / CDK(nodeJs) / AWS CLI. But no luck. I found solutions only about creating metrics with the filters etc and not much about enabling it.. Any suggestions?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

You can use MetricsConfiguration:

Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.

The example would be:

  MyBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: somey-bucket-3344-name
      MetricsConfigurations: 
        - Id: EntireBucket

Note EntireBucket. This is the required Id to enable the paid metrics.

over 4 years ago · Santiago Trujillo Relatório

0

The CDK equivalent for Marcin's answer would be to use the Bucket construct:

new Bucket(this, 'metric-example-bucket', {
  bucketName: "somey-bucket-3344-name",
  metrics: [{
    id: "EntireBucket"
  }]
}) 

If you've already created that bucket in CDK, you can use the addMetric() method:

existingBucket.addMetric({id: "EntireBucket"})
over 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