-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Switch AWS NAT Gateway creation to use tags on create #8726
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rifelpet The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
upup/pkg/fi/cloudup/awstasks/tags.go
Outdated
@@ -62,3 +62,15 @@ func intersectTags(tags []*ec2.Tag, desired map[string]string) map[string]string | |||
} | |||
return actual | |||
} | |||
|
|||
func mapToTagSpecification(tags map[string]string, resourceType string) *ec2.TagSpecification { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are a few other places where TagSpecification is used and this should be used to replace the tag conversion there.
@rifelpet I just gave this a try and created the NAT GW with tags. |
I think i have to update cloudmock with equivalent logic https://github.com/kubernetes/kops/blob/master/cloudmock/aws/mockec2/natgateway.go I'm hoping to get to that soon. |
No rush. Just wanted to let you know that it works :). |
d3d1aa3
to
9305952
Compare
my other recent PRs have made this much simpler. This will still use ec2.CreateTags for the |
/lgtm |
/retest |
AWS has been adding support for "tag on create" to many services. Typically this support also includes referencing tags in IAM policies involving these resources.
This means kops could use a more locked-down IAM policy that only allows creating NAT Gateways if they include cluster-specific tags, for example. Ideally we could use this for as many resource types as possible and have a much more locked down example IAM policy for kops users.
Marking WIP until I get a chance to test this locally since none of our e2e jobs create NAT gateways.