Skip to content

fix(aws)!: Unified tag structure#3330

Merged
kodiakhq[bot] merged 7 commits intocloudquery:mainfrom
disq:fix/aws-unify-tags
Nov 1, 2022
Merged

fix(aws)!: Unified tag structure#3330
kodiakhq[bot] merged 7 commits intocloudquery:mainfrom
disq:fix/aws-unify-tags

Conversation

@disq
Copy link
Copy Markdown
Member

@disq disq commented Oct 31, 2022

Fixes #3280

All tags (except one) should be JSON objects (and not JSON arrays) now.
The exception is aws_autoscaling_groups, which tags is defined as []TagDescription, which is defined as:

// Describes a tag for an Auto Scaling group.
type TagDescription struct {

	// The tag key.
	Key *string

	// Determines whether the tag is added to new instances as they are launched in the
	// group.
	PropagateAtLaunch *bool

	// The name of the group.
	ResourceId *string

	// The type of resource. The only supported value is auto-scaling-group.
	ResourceType *string

	// The tag value.
	Value *string

	noSmithyDocumentSerde
}

Name: "user_tags",
Type: schema.TypeJSON,
Resolver: `client.ResolveTags`,
Resolver: `client.ResolveTags`, // FIXME this is wrong, add path
Copy link
Copy Markdown
Member Author

@disq disq Oct 31, 2022

Choose a reason for hiding this comment

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

This needs to be client.ResolveTagField("User.Tags") or something like that but I'm not sure about the syntax... (parent struct also has Tags and it's handled by the auto resolver)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Tested: User tags are not exposed in the User struct from ListVirtualMFADevices, so removing this column.

Copy link
Copy Markdown
Member

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

Nice touch with the custom resolver.

I think this should be a fix! as it's a breaking change (even without the column rename)

@disq
Copy link
Copy Markdown
Member Author

disq commented Oct 31, 2022

I think this should be a fix! as it's a breaking change (even without the column rename)

JSON is JSON though... and we weren't intending these to be arrays.

@erezrokah
Copy link
Copy Markdown
Member

JSON is JSON though... and we weren't intending these to be arrays.

Yeah, but the schema of the JSON is different correct? i.e. if someone has a query on it, that query will break?

@disq
Copy link
Copy Markdown
Member Author

disq commented Oct 31, 2022

JSON is JSON though... and we weren't intending these to be arrays.

Yeah, but the schema of the JSON is different correct? i.e. if someone has a query on it, that query will break?

yes but it will be better in the end

@disq disq changed the title fix(aws): Unified tag structure fix!(aws): Unified tag structure Oct 31, 2022
@disq disq changed the title fix!(aws): Unified tag structure fix(aws)!: Unified tag structure Oct 31, 2022
@erezrokah
Copy link
Copy Markdown
Member

yes but it will be better in the end

Agree it's better but it's still breaking, and with a major version bump it's clear to users that they need to update their queries

@Barneyjm
Copy link
Copy Markdown
Contributor

Agree it's better but it's still breaking, and with a major version bump it's clear to users that they need to update their queries

FWIW the columns in some of these tables pre-V1 are type(Object) but in V1 are type(Array). This change would make it so that we don't have breaking changes

@erezrokah
Copy link
Copy Markdown
Member

FWIW the columns in some of these tables pre-V1 are type(Object) but in V1 are type(Array). This change would make it so that we don't have breaking changes

Thanks for the added context @Barneyjm. Agree this is not breaking compared to v0, but it can be considered breaking compared to the latest version of the latest AWS plugin.

We can make this clear with a note in the changelog, WDYT?

@bbernays
Copy link
Copy Markdown
Collaborator

This doesn't help resources that have to make specific call to get tags like Neptune/DocDB/RDS:

Name: "tags",
Type: schema.TypeJSON,
Resolver: `resolveNeptuneClusterParameterGroupTags`,
},

@disq disq requested a review from candiduslynx October 31, 2022 15:30
@disq disq force-pushed the fix/aws-unify-tags branch from 455b358 to fbc4cd4 Compare November 1, 2022 13:33
@disq disq added automerge Automatically merge once required checks pass priority merge labels Nov 1, 2022
@kodiakhq kodiakhq bot merged commit c9c1e4c into cloudquery:main Nov 1, 2022
@disq disq deleted the fix/aws-unify-tags branch November 1, 2022 14:55
kodiakhq bot pushed a commit that referenced this pull request Nov 2, 2022
🤖 I have created a release *beep* *boop*
---


## [4.0.0](plugins-source-aws-v3.8.0...plugins-source-aws-v4.0.0) (2022-11-02)


### ⚠ BREAKING CHANGES

* **aws:** Unified tag structure (#3330)

### Features

* Add eventbridge resources ([#3160](#3160)) ([67d3a35](67d3a35))
* **aws:** Fraud Detector support ([#3076](#3076)) ([f0e309a](f0e309a))
* Migrate cli, plugins and destinations to new type system ([#3323](#3323)) ([f265a94](f265a94))
* Update AWS Services (new fields) ([#3324](#3324)) ([0b65803](0b65803))


### Bug Fixes

* Add id to aws_cloudfront_cache_policies, region to aws_ec2_transit_gateways ([#3444](#3444)) ([41362e2](41362e2))
* **aws:** Unified tag structure ([#3330](#3330)) ([c9c1e4c](c9c1e4c))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/credentials to v1.12.23 ([#3378](#3378)) ([c33bf73](c33bf73))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.11.37 ([#3379](#3379)) ([3f1a71d](3f1a71d))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/acm to v1.15.2 ([#3380](#3380)) ([b4329ee](b4329ee))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/apigateway to v1.15.22 ([#3381](#3381)) ([5816480](5816480))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/apigatewayv2 to v1.12.20 ([#3385](#3385)) ([2dd39a6](2dd39a6))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/applicationautoscaling to v1.15.20 ([#3386](#3386)) ([0702717](0702717))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/appsync to v1.15.12 ([#3387](#3387)) ([6bb936a](6bb936a))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/athena to v1.18.12 ([#3388](#3388)) ([e95f748](e95f748))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/autoscaling to v1.23.18 ([#3389](#3389)) ([5af977f](5af977f))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/backup to v1.17.11 ([#3390](#3390)) ([1ecaab7](1ecaab7))
* **deps:** Update module github.com/aws/aws-sdk-go-v2/service/cloudfront to v1.20.7 ([#3391](#3391)) ([46465d1](46465d1))
* **deps:** Update plugin-sdk for aws to v0.13.17 ([#3399](#3399)) ([f2cd266](f2cd266))
* **deps:** Update plugin-sdk for aws to v0.13.18 ([#3409](#3409)) ([92fa576](92fa576))
* Filtering for DocDB + Neptune ([#3271](#3271)) ([8080c6e](8080c6e))
* Update endpoints ([#3368](#3368)) ([b78c6b1](b78c6b1))

---
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.

Tags Columns in V1 aren't unified

8 participants