Skip to content

fix(aws): Remove account validation#6226

Merged
kodiakhq[bot] merged 4 commits intocloudquery:mainfrom
erezrokah:fix/remove_account_validation
Jan 2, 2023
Merged

fix(aws): Remove account validation#6226
kodiakhq[bot] merged 4 commits intocloudquery:mainfrom
erezrokah:fix/remove_account_validation

Conversation

@erezrokah
Copy link
Copy Markdown
Member

Summary

Leaving this open for tomorrow. A user on Discord reported that a previously working configuration stopped working on v9.0.1.

Relevant configuration:

  kind: source
  spec:
    name: aws
    path: cloudquery/aws
    version: "v9.0.1"
    destinations: ["postgresql"]
    tables: ["*"]
    skip_tables:
** snipped for copy/paste **
    spec:
      regions:
        - us-east-1
        - us-east-2
        - us-west-1
        - us-west-2
      accounts:
        - id: "services"
          role_arn: "arn:aws:iam::XXXXXXXXXXXX:role/security/cloudquery-ro-role"
          role_session_name: "cloudquery_inventory"
        - id: "prod"
          role_arn: "arn:aws:iam::XXXXXXXXXXXX:role/security/cloudquery-ro-role"
          role_session_name: "cloudquery_inventory"

Error:

spec validation failed: invalid accounts: invalid account id: services (should be 12 digits)"

It seems users should be able to use the alias of an account in the configuration. Keeping open for discussion and so that users can subscribe to get updates on this.
Also not sure about the skip_member_accounts validation (I kept that one).

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cloudquery-web 🔄 Building (Inspect) Jan 1, 2023 at 5:08PM (UTC)

@cq-bot cq-bot added the aws label Jan 1, 2023
Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erezrokah This looks good, thanks! I'd say let's remove the account validation function entirely (so for OU accounts as well). It wasn't necessary. We can follow up to make sure that both account numbers and names are accepted by that as well, and if they aren't we should make it work the same way as the top-level list in any case

@hermanschaaf
Copy link
Copy Markdown
Contributor

Oh and just to be clear, let's keep the OU name validation. I believe that is still valid.

@erezrokah
Copy link
Copy Markdown
Member Author

Oh and just to be clear, let's keep the OU name validation. I believe that is still valid.

👍 Done in 5623288.

Also added an account alias to the tests

@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Jan 2, 2023
@kodiakhq kodiakhq bot merged commit 98dc0b2 into cloudquery:main Jan 2, 2023
kodiakhq bot pushed a commit that referenced this pull request Jan 2, 2023
🤖 I have created a release *beep* *boop*
---


## [9.1.0](plugins-source-aws-v9.0.1...plugins-source-aws-v9.1.0) (2023-01-02)


### Features

* **aws:** Route53 Add transfer lock Status ([#6022](#6022)) ([c3f0e37](c3f0e37))


### Bug Fixes

* **aws:** Remove account validation ([#6226](#6226)) ([98dc0b2](98dc0b2))
* **deps:** Update github.com/gocarina/gocsv digest to 1fea7ae ([#6168](#6168)) ([6fc737b](6fc737b))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/apigateway to v1.15.28 ([#6141](#6141)) ([5a7b876](5a7b876))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/cloudfront to v1.23.0 ([#6159](#6159)) ([6e42815](6e42815))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/elasticache to v1.25.0 ([#6111](#6111)) ([b1f5d4b](b1f5d4b))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/emr to v1.21.0 ([#6142](#6142)) ([d68af16](d68af16))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/rds to v1.38.0 ([#6112](#6112)) ([549e290](549e290))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/secretsmanager to v1.17.0 ([#6143](#6143)) ([2d99f4f](2d99f4f))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/transfer to v1.27.0 ([#6049](#6049)) ([87cf1f6](87cf1f6))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.14.0 ([#6025](#6025)) ([35b2cfc](35b2cfc))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.15.0 ([#6071](#6071)) ([684b525](684b525))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.15.1 ([#6079](#6079)) ([650659c](650659c))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.16.0 ([#6098](#6098)) ([7bacdf3](7bacdf3))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.16.1 ([#6214](#6214)) ([53b2415](53b2415))
* Update endpoints ([#6136](#6136)) ([808ffab](808ffab))
* Update endpoints ([#6158](#6158)) ([dd773b8](dd773b8))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants