Skip to content

Conversation

@disq
Copy link
Member

@disq disq commented Jul 25, 2023

Currently untested Seems to be working.

Fixes #12461

…s` and `aws_cloudformation_stack_instance_resource_drifts`
@github-actions
Copy link

This PR has the following changes to source plugin(s) tables:

  • Table aws_cloudformation_stack_instance_resource_drifts was added
  • Table aws_cloudformation_stack_instance_summaries was added

stackSet := parent.Parent.Item.(models.ExpandedStackSet)
instance := parent.Item.(models.ExpandedStackInstanceSummary)
config := cloudformation.ListStackInstanceResourceDriftsInput{
OperationId: instance.LastOperationId,
Copy link
Member Author

@disq disq Jul 25, 2023

Choose a reason for hiding this comment

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

Not sure if using LastOperationId is correct (it works, but not sure if it would be enough for use cases etc.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you are doing it correctly

Description: `https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StackSetOperationResultSummary.html.
The 'request_account_id' and 'request_region' columns are added to show the account and region of where the request was made from.`,
Resolver: fetchStackInstanceResourceDrifts,
Transform: transformers.TransformWithStruct(&types.StackInstanceResourceDriftsSummary{}),
Copy link
Member Author

Choose a reason for hiding this comment

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

I left out PKs from the table.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can use all of the inputs (minus CallAs) as pks + logical_resource_id or physical_resource_id

Copy link
Member Author

Choose a reason for hiding this comment

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

I think logical and physical both need to be used in that case, but it gets complicated:

	// Context information that enables CloudFormation to uniquely identify a
	// resource. CloudFormation uses context key-value pairs in cases where a
	// resource's logical and physical IDs aren't enough to uniquely identify that
	// resource. Each context key-value pair specifies a unique resource that contains
	// the targeted resource.
	PhysicalResourceIdContext []PhysicalResourceIdContextKeyValuePair

Copy link
Collaborator

@bbernays bbernays Jul 25, 2023

Choose a reason for hiding this comment

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

But we don't need to uniquely identify a resource in a region/account, we just need to uniquely identify a resource within a specific stack (unless I am missing something)

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I gave it a go in 7c7e059 (#12495). Account and region seems to be filled in in the stack set arn and stack id (different accounts/regions too) so I've omitted those from the PK.

@disq disq requested a review from bbernays July 25, 2023 15:03
@disq disq changed the title feat(cloudformation): Add aws_cloudformation_stack_instance_summaries and aws_cloudformation_stack_instance_resource_drifts feat(resources-cloudformation): Add aws_cloudformation_stack_instance_summaries and aws_cloudformation_stack_instance_resource_drifts Jul 25, 2023
@disq disq marked this pull request as ready for review July 25, 2023 17:19
@disq disq changed the title feat(resources-cloudformation): Add aws_cloudformation_stack_instance_summaries and aws_cloudformation_stack_instance_resource_drifts feat(resources-cloudformation): Add Support for Cloudformation Stack Instance Summaries and Stack Instance Resource Drifts Jul 26, 2023
@bbernays bbernays changed the title feat(resources-cloudformation): Add Support for Cloudformation Stack Instance Summaries and Stack Instance Resource Drifts feat(resources): Add Support for Cloudformation Stack Instance Summaries and Stack Instance Resource Drifts Jul 26, 2023
Copy link
Collaborator

@bbernays bbernays left a comment

Choose a reason for hiding this comment

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

LGTM

@disq disq added the automerge Automatically merge once required checks pass label Jul 27, 2023
@kodiakhq kodiakhq bot merged commit e1d9a74 into cloudquery:main Jul 27, 2023
@disq disq deleted the feat/cloudformation_stack branch July 27, 2023 08:42
kodiakhq bot pushed a commit that referenced this pull request Jul 27, 2023
🤖 I have created a release *beep* *boop*
---


## [22.2.0](plugins-source-aws-v22.1.0...plugins-source-aws-v22.2.0) (2023-07-27)


### This Release has the Following Changes to Tables
- Table `aws_cloudformation_stack_instance_resource_drifts` was added
- Table `aws_cloudformation_stack_instance_summaries` was added
- Table `aws_emr_studio_session_mappings` was added
- Table `aws_emr_studios` was added
- Table `aws_route53recoverycontrolconfig_clusters` was added
- Table `aws_route53recoverycontrolconfig_control_panels` was added
- Table `aws_route53recoverycontrolconfig_routing_controls` was added
- Table `aws_route53recoverycontrolconfig_safety_rules` was added
- Table `aws_route53recoveryreadiness_cells` was added
- Table `aws_route53recoveryreadiness_readiness_checks` was added
- Table `aws_route53recoveryreadiness_recovery_groups` was added
- Table `aws_route53recoveryreadiness_resource_sets` was added
- Table `aws_s3_multi_region_access_points` was added

### Features

* **resources-s3:** Add support for S3 Multi Region Access Points ([#12525](#12525)) ([00c6a3f](00c6a3f))
* **resources:** Add additional emr resources for studio and studio session mapping ([#12529](#12529)) ([66a20a5](66a20a5))
* **resources:** Add Support for Amazon Route 53 ARC Recovery Control Configuration ([#12460](#12460)) ([8c3109b](8c3109b))
* **resources:** Add Support for Cloudformation Stack Instance Summaries and Stack Instance Resource Drifts ([#12495](#12495)) ([e1d9a74](e1d9a74)), closes [#12461](#12461)
* **resources:** Add Support for Route53 ARC Recovery Readiness ([#12459](#12459)) ([7d6d4c0](7d6d4c0))

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

feat: Add CloudFormation Resource Drift to AWS source plugin

3 participants