Skip to content

Commit

Permalink
fix: can't specify tags when importing
Browse files Browse the repository at this point in the history
  • Loading branch information
the-avid-engineer committed Jun 13, 2024
1 parent 8e47a5b commit 48bcc67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/InfrastructureCli/Services/AwsCloudFormationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,19 @@ private async Task<bool> CreateStackWithChangeSet(DeployOptions deployOptions)

ChangeSetType changeSetType;
List<ResourceToImport>? resourcesToImport;
List<Tag>? tags;

if (deployOptions.Options.TryGetValue("ResourcesToImport", out var resourcesToImportJson))
{
changeSetType = ChangeSetType.IMPORT;
resourcesToImport = JsonSerializer.Deserialize<List<ResourceToImport>>(resourcesToImportJson);
tags = null;
}
else
{
changeSetType = ChangeSetType.CREATE;
resourcesToImport = null;
tags = GetTags();
}

var request = new CreateChangeSetRequest
Expand All @@ -516,7 +519,7 @@ private async Task<bool> CreateStackWithChangeSet(DeployOptions deployOptions)
ChangeSetName = changeSetName,
StackName = GetStackName(),
Capabilities = GetCapabilities(),
Tags = GetTags(),
Tags = tags,
TemplateBody = GetTemplateBody(deployOptions.Template),
Parameters = await GetParameters(deployOptions.Parameters)
};
Expand Down

0 comments on commit 48bcc67

Please sign in to comment.