Closed tylersouthwick closed 3 years ago
The issue we've run into is that in this case, you are unable to use the same template to deploy a new version of the module. You have to manage the state external to cloudformation and know whether the stack deployment is the first deployment or the second. This makes using stacksets for multi account deployment really difficult.
Here are the paths I see:
ModuleVersion
and that is set implicitly as the defaultModuleVersion
to be created, but it is not the defaultModuleVersion
, but it cannot because it is the defaultModuleVersion
and a DefaultModuleVersion
in the same templateDefaultModuleVersion
fails to deploy because the ModuleVersion is already a defaultWe have a current workaround, but it is really clunky. The example on https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html shows 2
different modules defined, but setting the default version only on ModuleVersion2
. ModuleVersion1
is essentially only used to define the existence of the module.
Ideally, we could have a single template that defines only a ModuleVersion
and a ModuleVersion
that can then be updated when the module changes and can also be used for the initial deployment.
Hi Tyler, thank you for your patience. We're sorry you have to workaround this issue. We're having discussions with CloudFormation product managers, engineering managers and owners of ResourceDefaultVersion
to discuss the path forward for ModuleDefaultVersion
.
We understand that removing AlreadyExists
in this scenario would be better customer experience. We'll get back to you on this.
Hi Tyler, your change has been merged. There was some delay because Travis CI builds were stuck for our repository. Once we migrated to GitHub Actions, that blocker was resolved.
We'll be deploying your change to production soon. I'll inform you once that completes here.
Hi Tyler, our deployment is complete. Setting a ModuleDefaultVersion
in a template to a version that is already the default version should not report an error now. Thanks for your patience.
If module was already defined, but all versions were deregistered, adding a new module/module default version in the same template fails.
It seems to fail due to this check: https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-cloudformation/blob/master/aws-cloudformation-moduledefaultversion/src/main/java/software/amazon/cloudformation/moduledefaultversion/CreateHandler.java#L42
I'm assuming that check is there to prevent an implicit "import" of a different default version?