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

Add aws_default_vpc and aws_vpc support #25

Merged
merged 1 commit into from
Dec 17, 2020
Merged

Conversation

eliecharra
Copy link
Contributor

@eliecharra eliecharra commented Dec 15, 2020

Q A
πŸ› Bug fix? yes
πŸš€ New feature? yes
⚠ Deprecations? no
❌ BC Break no
πŸ”— Related issues #15 #14
❓ Documentation yes

Description

Add support for

  • aws_default_vpc
  • aws_vpc

⚠️ This PR will also add support for returning mixed resources types from a single supplier

@eliecharra eliecharra added the kind/enhancement New feature or improvement label Dec 15, 2020
@eliecharra eliecharra added this to the v0.2.0 milestone Dec 15, 2020
@eliecharra eliecharra requested a review from a team as a code owner December 15, 2020 10:15
@eliecharra eliecharra self-assigned this Dec 15, 2020
@codecov
Copy link

codecov bot commented Dec 15, 2020

Codecov Report

Merging #25 (bbe91ff) into main (b3fc74b) will decrease coverage by 0.06%.
The diff coverage is 65.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
- Coverage   67.06%   67.00%   -0.07%     
==========================================
  Files         140      146       +6     
  Lines        3073     3179     +106     
==========================================
+ Hits         2061     2130      +69     
- Misses        783      809      +26     
- Partials      229      240      +11     
Impacted Files Coverage Ξ”
pkg/driftctl.go 0.00% <0.00%> (ΓΈ)
pkg/remote/aws/init.go 0.00% <0.00%> (ΓΈ)
pkg/resource/aws/aws_vpc.go 50.00% <50.00%> (ΓΈ)
pkg/remote/aws/vpc_supplier.go 61.11% <61.11%> (ΓΈ)
...ource/aws/deserializer/default_vpc_deserializer.go 61.53% <61.53%> (ΓΈ)
pkg/resource/aws/deserializer/vpc_deserializer.go 61.53% <61.53%> (ΓΈ)
pkg/middlewares/aws_default_vpc.go 83.33% <83.33%> (ΓΈ)
pkg/iac/deserializers.go 100.00% <100.00%> (ΓΈ)
pkg/resource/aws/aws_default_vpc.go 100.00% <100.00%> (ΓΈ)
... and 5 more

@eliecharra eliecharra changed the title Add aws_default_vpc support Add VPC support Dec 16, 2020
@eliecharra eliecharra marked this pull request as draft December 16, 2020 09:16
@eliecharra eliecharra force-pushed the add_default_vpc branch 2 times, most recently from ecfec35 to 1ca42a2 Compare December 16, 2020 11:11
@eliecharra eliecharra marked this pull request as ready for review December 16, 2020 11:12
IsDefault: aws.Bool(false),
},
},
}, true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be false here ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Even though this won't change the test itself and its results, we should make it so that it's logic for reading PR purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I've inverted this bool meaning in my mind πŸ‘πŸ» nice catch

return resourceaws.AwsVpcResourceType
}

func (s VPCDeserializer) Deserialize(recordList []cty.Value) ([]resource.Resource, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You kept the recordList from Route53 records, can you change it to something more inline with vpc, like vpcList and update all the lines below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, let's update it for something more generic like rawList as we use rawResource as iterator name in the loop.

return resourceaws.AwsDefaultVpcResourceType
}

func (s DefaultVPCDeserializer) Deserialize(recordList []cty.Value) ([]resource.Resource, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here for recordList

wbeuil
wbeuil previously approved these changes Dec 17, 2020
Copy link
Contributor

@wbeuil wbeuil left a comment

Choose a reason for hiding this comment

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

LGTM

moadibfr
moadibfr previously approved these changes Dec 17, 2020
@eliecharra eliecharra dismissed stale reviews from moadibfr and wbeuil via bbe91ff December 17, 2020 17:27
@eliecharra eliecharra merged commit d183d36 into main Dec 17, 2020
@eliecharra eliecharra deleted the add_default_vpc branch December 17, 2020 17:30
@eliecharra eliecharra linked an issue Dec 17, 2020 that may be closed by this pull request
@eliecharra eliecharra linked an issue Dec 17, 2020 that may be closed by this pull request
@eliecharra eliecharra changed the title Add VPC support Add aws_default_vpc and aws_vpc support Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support aws_default_vpc Support aws_vpc
3 participants