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

Fix VPC policy in CAPA controller role CloudFormation template #127

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 33 additions & 30 deletions capa-controller-role/cloud-formation-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ Resources:
- Key: "installation"
Value: !Ref InstallationName

GiantSwarmCapaControllerPolicy:
Type: "AWS::IAM::Policy"
GiantSwarmCapaControllerManagedPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-capa-controller-policy"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-capa-controller-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand Down Expand Up @@ -197,11 +197,11 @@ Resources:
Roles:
- !Ref GiantSwarmCapaControllerRole

GiantSwarmCapaControllerPolicyVpc:
GiantSwarmCapaControllerVpcManagedPolicy:
Condition: CreateVpcPolicy
Type: "AWS::IAM::Policy"
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-capa-controller-policy-vpc"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-capa-controller-vpc-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand Down Expand Up @@ -230,11 +230,14 @@ Resources:
- "ec2:DisassociateVpcCidrBlock"
- "ec2:ModifySubnetAttribute"
- "ec2:ReplaceRoute"
Resource: "*"
Roles:
- !Ref GiantSwarmCapaControllerRole

GiantSwarmDNSControllerPolicy:
Type: "AWS::IAM::Policy"
GiantSwarmDNSControllerManagedPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-dns-controller-policy"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-dns-controller-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand All @@ -247,10 +250,10 @@ Resources:
Roles:
- !Ref GiantSwarmCapaControllerRole

GiantSwarmCrossplanePolicy:
Type: "AWS::IAM::Policy"
GiantSwarmCrossplaneManagedPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-crossplane-policy"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-crossplane-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand All @@ -271,10 +274,10 @@ Resources:
Roles:
- !Ref GiantSwarmCapaControllerRole

GiantSwarmEKSControllerPolicy:
Type: "AWS::IAM::Policy"
GiantSwarmEKSControllerManagedPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-eks-controller-policy"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-eks-controller-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand Down Expand Up @@ -369,10 +372,10 @@ Resources:
Roles:
- !Ref GiantSwarmCapaControllerRole

GiantSwarmIAMControllerPolicy:
Type: "AWS::IAM::Policy"
GiantSwarmIAMControllerManagedPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-iam-controller-policy"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-iam-controller-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand Down Expand Up @@ -401,10 +404,10 @@ Resources:
Roles:
- !Ref GiantSwarmCapaControllerRole

GiantSwarmIRSAControllerPolicy:
Type: "AWS::IAM::Policy"
GiantSwarmIRSAControllerManagedPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-irsa-controller-policy"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-irsa-controller-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand Down Expand Up @@ -463,10 +466,10 @@ Resources:
Roles:
- !Ref GiantSwarmCapaControllerRole

GiantSwarmMCBootstrapPolicy:
Type: "AWS::IAM::Policy"
GiantSwarmMCBootstrapManagedPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-mc-bootstrap-policy"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-mc-bootstrap-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand All @@ -476,10 +479,10 @@ Resources:
Roles:
- !Ref GiantSwarmCapaControllerRole

GiantSwarmNetworkTopologyControllerPolicy:
Type: "AWS::IAM::Policy"
GiantSwarmNetworkTopologyControllerManagedPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-network-topology-controller-policy"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-network-topology-controller-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand All @@ -506,10 +509,10 @@ Resources:
Roles:
- !Ref GiantSwarmCapaControllerRole

GiantSwarmResolverRulesOperatorPolicy:
Type: "AWS::IAM::Policy"
GiantSwarmResolverRulesOperatorManagedPolicy:
Type: "AWS::IAM::ManagedPolicy"
Properties:
PolicyName: !Sub "giantswarm-${InstallationName}-resolver-rules-operator-policy"
ManagedPolicyName: !Sub "giantswarm-${InstallationName}-resolver-rules-operator-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
Expand Down