Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

396
Vistas
Python AWS CDK resource already exists error

I'm trying to create a canary deployment using the Python sdk for AWS CDK. This is the pertinent part of the code:

canary = CfnCanary(
        scope=self,
        id='canary',
        execution_role_arn=canary_execution_role.role_arn,
        name='canary-example',
        run_config=CfnCanary.RunConfigProperty(timeout_in_seconds=1),
        runtime_version='syn-1.0',
        schedule=CfnCanary.ScheduleProperty(duration_in_seconds='5', expression='rate(0 minute)'),
        artifact_s3_location=f's3://{bucket.bucket_name}',
        start_canary_after_creation=False,
        code=CfnCanary.CodeProperty(s3_bucket='s3://canary-script-002', handler='handler.handler', s3_key='handler.handler')
    )

I'm getting this error, even when I check that there's no other canary created:

Resource of type 'AWS::Synthetics::Canary' with identifier '{"/properties/Name":"canary-example"}' already exists.

As I said, I already checked in the console for the existence of other canary (there's none), and I destroy the created stack before trying again.

Any ideas?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I've had success with similar situations by adding a random string to the name of the resource (using Date.Now() works in TypeScript or the equivalent in Python). This forces CloudFormation to delete, and re-create the resource on each deploy.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda