Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws): Implement the account API for AWS accounts #6209

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dzhengg
Copy link
Contributor

@dzhengg dzhengg commented May 15, 2024

The commit with the fix solves the following issue:
Test amazon account:

> cat test-aws-iam-account.json
{
  "name": "test-aws-iam-account",
  "type": "aws",
  "accountId": "123456789012",
  "regions": [
    {
      "name": "us-west-2"
    },
    {
      "name": "us-east-2"
    }
  ],
  "lambdaEnabled": true,
  "assumeRole": "role/myrole"
}

Before the change:

> curl -X PUT -H "Content-Type: application/json" -H "X-SPINNAKER-USER: account-manager" [email protected] http://localhost:8080/credentials
{"error":"Internal Server Error","exception":"java.lang.NullPointerException","message":"null","status":500,"timestamp":1710223163791}

After the change:

> curl -X PUT -H "Content-Type: application/json" -H "X-SPINNAKER-USER: account-manager" [email protected] http://localhost:8080/credentials
{"type":"aws","accountId":"123456789012","allowPrivateThirdPartyImages":false,"assumeRole":"role/myrole","dedicatedTenancy":false,"enableFips":false,"lambdaEnabled":true,"name":"test-aws-iam-account","permissions":{},"regions":[{"name":"us-east-2"},{"name":"us-west-2"}],"requiredGroupMembership":[]}

This change allows clouddriver AWS accounts to use the account
management API. Specifically, it allows clouddriver to load
AWS accounts from the AccountDefinitionRepository used by
the account API.
@dzhengg dzhengg marked this pull request as draft May 15, 2024 13:06
An account without requiredGroupMembership or permissions is a
valid account. However, certain areas of the code assume that these
values are not null and therefore encounter NullPointerExceptions.
To avoid this, initialize these fields to a reasonable default value.
@dzhengg dzhengg force-pushed the account-api-aws branch from 8aa8de4 to 1d665f3 Compare May 15, 2024 13:07
@dzhengg dzhengg marked this pull request as ready for review May 15, 2024 15:49
@dzhengg dzhengg marked this pull request as draft May 15, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant