Skip to content

Commit

Permalink
updating task and stack fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
numcys committed Oct 23, 2024
1 parent f18ed3e commit bb5631e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions provider/aws/processes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ func (p *Provider) generateTaskDefinition2(app, service string, opts structs.Pro
}

aps := stackParameters(as)
// aos := stackOutputs(as)
aos := stackOutputs(as)

senv := s.EnvironmentDefaults()

Expand Down Expand Up @@ -1209,15 +1209,21 @@ func (p *Provider) generateTaskDefinition2(app, service string, opts structs.Pro
nestedStackName := describeStackOutput.Stacks[0].StackName

ts, err := p.stackResource(*nestedStackName, "DedicatedRole")
if err != nil {
if err != nil && !strings.Contains(err.Error(), "resource not found") {
return nil, err
}

var taskRoleArn *string
if ts != nil {
taskRoleArn = aws.String(fmt.Sprintf("convox/%s", *ts.PhysicalResourceId))
} else {
taskRoleArn = aws.String(aos["ServiceRole"])
}

req := &ecs.RegisterTaskDefinitionInput{
ContainerDefinitions: []*ecs.ContainerDefinition{cd},
Family: aws.String(fmt.Sprintf("%s-%s-%s", p.Rack, app, service)),
// TaskRoleArn: aws.String(aos["ServiceRole"]),
TaskRoleArn: aws.String(*ts.PhysicalResourceId),
TaskRoleArn: taskRoleArn,
Volumes: vs,
}

Expand Down

0 comments on commit bb5631e

Please sign in to comment.