Skip to content

Commit

Permalink
Revert "convox run supports policies added to service (#3743)"
Browse files Browse the repository at this point in the history
This reverts commit d0c8f9a.
  • Loading branch information
nightfury1204 authored Oct 31, 2024
1 parent d0c8f9a commit a124312
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions provider/aws/processes.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/cloudformation"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/ecs"
Expand Down Expand Up @@ -1124,10 +1123,10 @@ func (p *Provider) generateTaskDefinition2(app, service string, opts structs.Pro
return nil, err
}

ResourceEnvVariables := map[string]string{"URL": "Url", "NAME": "Name", "HOST": "Host", "PASS": "Pass", "PORT": "Port", "USER": "User"}
ResourceEnvVariables := map[string]string{"URL":"Url","NAME":"Name","HOST":"Host","PASS":"Pass","PORT":"Port","USER":"User"}
ResourceName := strings.Replace(strings.ToUpper(r), "-", "_", -1)

for k, v := range ResourceEnvVariables {
for k,v := range ResourceEnvVariables{
senv[fmt.Sprintf("%s_%s", ResourceName, k)] = stackOutputs(rs)[v]
}
}
Expand Down Expand Up @@ -1192,38 +1191,10 @@ func (p *Provider) generateTaskDefinition2(app, service string, opts structs.Pro
}
}

td, err := p.stackResource(fmt.Sprintf("%s-%s", p.Rack, app), "ServiceWeb")
if err != nil {
return nil, err
}

nestedStackID := td.PhysicalResourceId

describeStackOutput, err := p.cloudformation().DescribeStacks(&cloudformation.DescribeStacksInput{
StackName: nestedStackID,
})
if err != nil {
return nil, err
}

nestedStackName := describeStackOutput.Stacks[0].StackName

ts, err := p.stackResource(*nestedStackName, "DedicatedRole")
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: taskRoleArn,
TaskRoleArn: aws.String(aos["ServiceRole"]),
Volumes: vs,
}

Expand Down

0 comments on commit a124312

Please sign in to comment.