From a124312cee1be209f317b5a43aca2dc403dad6e7 Mon Sep 17 00:00:00 2001 From: "Md. Nure Alam Nahid" Date: Thu, 31 Oct 2024 19:23:06 +0000 Subject: [PATCH] Revert "convox run supports policies added to service (#3743)" This reverts commit d0c8f9a43fcaca7b3251a0854da2b3b50c92b812. --- provider/aws/processes.go | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/provider/aws/processes.go b/provider/aws/processes.go index 243e81813..b162df036 100644 --- a/provider/aws/processes.go +++ b/provider/aws/processes.go @@ -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" @@ -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] } } @@ -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, }