aws / aws/aws-toolkit-azure-devops

AWS Credentials - Use Variable in deployment group fails

Open
#307 2 comments 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
TypeScript
Stars
258
Forks
114
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I have a deployment with multiple stages which are deployed to individual AWS organizations. Thus, I need to specify specific connections for each stage. So I set the AWS credential to `$(AWSAccount)`. This works for normal deployments. However, it fails when used in a deployment-group deployment.

It fails with this log:
```
2019-11-06T14:51:00.6561140Z Configuring credentials for task
2019-11-06T14:51:00.6561308Z ##[debug]awsCredentials=AWS - Staging
2019-11-06T14:51:00.6561424Z ##[debug]task result: Failed
2019-11-06T14:51:00.6592575Z ##[error]Endpoint auth data not present: AWS - Staging
2019-11-06T14:51:00.6592978Z ##[debug]Processed: ##vso[task.issue type=error;]Endpoint auth data not present: AWS - Staging
2019-11-06T14:51:00.6616183Z ##[debug]Processed: ##vso[task.complete result=Failed;]Endpoint auth data not present: AWS - Staging
2019-11-06T14:51:00.6618671Z AWS - Staging exists false
2019-11-06T14:51:00.6619389Z ##[debug]AWS - Staging exists false
2019-11-06T14:51:00.6619622Z ...configuring AWS credentials from service endpoint 'AWS - Staging'
```

If I enter the actual endpoint directly, the log looks like this:
```
019-11-06T14:28:09.1626091Z Configuring credentials for task
2019-11-06T14:28:09.1626889Z 1f20638e-2d31-4a06-9230-f6a63f123089 exists true
2019-11-06T14:28:09.1627728Z ...configuring AWS credentials from service endpoint '1f20638e-2d31-4a06-9230-f6a63f123089'
2019-11-06T14:28:09.1627972Z ...endpoint defines standard access/secret key credentials
```

But this only happens on a Deployment Group job. It seems that the connection name is not being properly translated to its Id when run on a Deployment Group Job.

**To reproduce**
Use an AWS task in a deployment group job. Specify the AWS credential via a variable like `$(AWSAccount)` and set the variable value to the name of an AWS credential.

**Expected behavior**
The task executes successfully.

**Your Environment**
Azure Devops Server 2019, on-prem
AWS Tools 1.50

Contributor guide

Open the contributing guide

Research direction

Start by reproducing an AWS task in an Azure DevOps deployment-group job with the credential set to a variable, then compare its credential-resolution logs with a direct endpoint configuration. Trace the deployment-group credential path and verify that the variable's endpoint name resolves to the service endpoint ID and the task completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.