Port ECS deploy command from SPF#1897
Conversation
There was a problem hiding this comment.
God have mercy on our souls!
Let's mark this class as [Deprecated] from the get go so there's a persistent reminder to replace it.
@zentron Flagging that we need to chat about this
| TemplateFactory, | ||
| stackEventLogger, | ||
| StackProvider, | ||
| RoleArnProvider, |
There was a problem hiding this comment.
🚩 This is passed down to the template and attached to the Stack. or am I missing something here?
There was a problem hiding this comment.
Hmm it seemed unused to me in the convention.
Regardless I'll pull it out into a separate PR
There was a problem hiding this comment.
public override CreateStackRequest BuildCreateStackRequest()
{
return new CreateStackRequest
{
StackName = stackName,
TemplateBody = Content,
Parameters = Inputs.ToList(),
Capabilities = capabilities,
DisableRollback = disableRollback,
RoleARN = roleArn,
Tags = tags
};
}
public override UpdateStackRequest BuildUpdateStackRequest()
{
return new UpdateStackRequest
{
StackName = stackName,
TemplateBody = Content,
Parameters = Inputs.ToList(),
Capabilities = capabilities,
RoleARN = roleArn,
Tags = tags
};
}
public override async Task<CreateChangeSetRequest> BuildChangesetRequest()
{
return new CreateChangeSetRequest
{
StackName = stack.Value,
TemplateBody = Content,
Parameters = Inputs.ToList(),
/*
* The change set name might be passed down directly, or this variable may be
* set as part of the deployment. Reading the value from the variables here
* allows us to catch any deferred construction of the change stack name.
*/
ChangeSetName = variables[AwsSpecialVariables.CloudFormation.Changesets.Name],
ChangeSetType = await GetStackStatus() == StackStatus.DoesNotExist ? ChangeSetType.CREATE : ChangeSetType.UPDATE,
Capabilities = capabilities,
RoleARN = roleArn,
Tags = tags
};
}
It is passed to the SDK Request classes
| TemplateFactory, | ||
| stackEventLogger, | ||
| StackProvider, | ||
| _ => null, |
There was a problem hiding this comment.
nit: While this appears to make sense in the S3 case (vs. Below). Let's pull this out and do it as it's own little PR
Jtango18
left a comment
There was a problem hiding this comment.
Looks good. A few minor nits and concern about breaking existing functionality.
Reverts the earlier drop of the roleArnProvider parameter; existing callers keep their previous wiring and the new ECS step passes null.
02890ee to
5f80453
Compare
JT's commit added [Obsolete] to CamelCase but missed using System; for the attribute, and triggered TreatWarningsAsErrors on the two callers. Adds the missing using and suppresses CS0618 at the call sites that intentionally depend on the lodash port for SPF parity.
ECS deploy SPF step replacement in Calamari
Ref MD-1813
cf-ecs-{cluster}-{service}-{env}-{tenant}) used when the user doesn't supply one.camelCaseso Calamari and SPF produce byte-for-byte identical default stack names so that migrating from SPF to Calamari execution doesn't cause new CFN stacks to be createdCFN convention tweaks
waitTimeouton the wait-for-stack helper; throws on elapse.roleArnProviderparameter from the CFN convention constructor.