modules/mu/providers/aws/collection.rb in cloud-mu-3.2.0 vs modules/mu/providers/aws/collection.rb in cloud-mu-3.3.0

- old
+ new

@@ -240,19 +240,19 @@ # @param noop [Boolean]: If true, will only print what would be done # @param ignoremaster [Boolean]: If true, will remove resources not flagged as originating from this Mu server # @param region [String]: The cloud provider region # @param wait [Boolean]: Block on the removal of this stack; AWS deletion will continue in the background otherwise if false. # @return [void] - def self.cleanup(noop: false, ignoremaster: false, region: MU.curRegion, wait: false, credentials: nil, flags: {}) + def self.cleanup(noop: false, deploy_id: MU.deploy_id, ignoremaster: false, region: MU.curRegion, wait: false, credentials: nil, flags: {}) MU.log "AWS::Collection.cleanup: need to support flags['known']", MU::DEBUG, details: flags MU.log "Placeholder: AWS Collection artifacts do not support tags, so ignoremaster cleanup flag has no effect", MU::DEBUG, details: ignoremaster # XXX needs to check tags instead of name- possible? resp = MU::Cloud::AWS.cloudformation(credentials: credentials, region: region).describe_stacks resp.stacks.each { |stack| ok = false stack.tags.each { |tag| - ok = true if (tag.key == "MU-ID") and tag.value == MU.deploy_id + ok = true if (tag.key == "MU-ID") and tag.value == deploy_id } if ok MU.log "Deleting CloudFormation stack #{stack.stack_name})" next if noop if stack.stack_status != "DELETE_IN_PROGRESS"