Skip to content

Commit 0b65586

Browse files
committed
OCM-12364 | feat: Add hcpsharedvpc flags + deprecation warnings to create/cluster
1 parent 7c35aaa commit 0b65586

File tree

3 files changed

+66
-3
lines changed

3 files changed

+66
-3
lines changed

cmd/create/cluster/cmd.go

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ const (
9090
duplicateIamRoleArnErrorMsg = "ROSA IAM roles must have unique ARNs " +
9191
"and should not be shared with other IAM roles within the same cluster. " +
9292
"Duplicated ARN: %s"
93+
94+
route53RoleArnFlag = "route53-role-arn"
95+
vpcEndpointRoleArnFlag = "vpc-endpoint-role-arn"
96+
hcpInternalCommunicationHostedZoneIdFlag = "hcp-internal-communication-hosted-zone-id"
97+
ingressPrivateHostedZoneIdFlag = "ingress-private-hosted-zone-id"
9398
)
9499

95100
var args struct {
@@ -214,6 +219,20 @@ var args struct {
214219
sharedVPCRoleARN string
215220
baseDomain string
216221

222+
// HCP Shared VPC
223+
vpcEndpointRoleArn string
224+
//
225+
//route53RoleArn string
226+
// Route53 Role Arn is the same thing as `sharedVpcRoleArn` for now- deprecation warning will be in place
227+
// This is the same behavior as create/operatorroles
228+
//
229+
hcpInternalCommunicationHostedZoneId string
230+
//
231+
//ingressPrivateHostedZoneId string
232+
// Ingress Private Hosted Zone ID is the same thing as `privateHostedZoneID` for now- deprecation warning
233+
// will be in place
234+
//
235+
217236
// Worker machine pool attributes
218237
additionalComputeSecurityGroupIds []string
219238

@@ -820,6 +839,46 @@ func initFlags(cmd *cobra.Command) {
820839
"in private Route 53 hosted zone associated with intended shared VPC.",
821840
)
822841

842+
flags.StringVar(
843+
&args.vpcEndpointRoleArn,
844+
vpcEndpointRoleArnFlag,
845+
"",
846+
"AWS IAM Role ARN with policy attached, associated with the shared VPC."+
847+
" Grants permissions necessary to communicate with and handle a Hosted Control Plane cross-account VPC.")
848+
849+
flags.StringVar(
850+
&args.sharedVPCRoleARN,
851+
route53RoleArnFlag,
852+
"",
853+
"AWS IAM Role Arn with policy attached, associated with shared VPC."+
854+
" Grants permission necessary to handle route53 operations associated with a cross-account VPC. "+
855+
"This flag deprecates '--shared-vpc-role-arn'.",
856+
)
857+
858+
// Mark old sharedvpc role arn flag as deprecated for future transitioning of the flag name (both are usable for now)
859+
flags.MarkDeprecated("shared-vpc-role-arn", fmt.Sprintf("'--shared-vpc-role-arn' will be replaced with "+
860+
"'--%s' in future versions of ROSA.", route53RoleArnFlag))
861+
862+
flags.StringVar(
863+
&args.hcpInternalCommunicationHostedZoneId,
864+
hcpInternalCommunicationHostedZoneIdFlag,
865+
"",
866+
"The internal communication Route 53 hosted zone ID to be used for Hosted Control Plane cross-account "+
867+
"VPC, e.g., 'Z05646003S02O1ENCDCSN'.",
868+
)
869+
870+
flags.StringVar(
871+
&args.privateHostedZoneID,
872+
ingressPrivateHostedZoneIdFlag,
873+
"",
874+
"ID assigned by AWS to private Route 53 hosted zone associated with intended shared VPC, "+
875+
"e.g., 'Z05646003S02O1ENCDCSN'.",
876+
)
877+
878+
// Mark old private hosted zone id flag as deprecated for future transitioning of the flag (both are usable for now)
879+
flags.MarkDeprecated("private-hosted-zone-id", fmt.Sprintf("'--private-hosted-zone-id' will be "+
880+
"replaced with '--%s' in future versions of ROSA.", ingressPrivateHostedZoneIdFlag))
881+
823882
flags.StringVar(
824883
&args.baseDomain,
825884
"base-domain",

cmd/create/operatorroles/cmd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func init() {
139139
vpcEndpointRoleArnFlag,
140140
"",
141141
"AWS IAM Role ARN with policy attached, associated with the shared VPC."+
142-
" Grants permissions necessary to communicate with and handle a cross-account VPC.",
142+
" Grants permissions necessary to communicate with and handle a Hosted Control Plane cross-account VPC.",
143143
)
144144

145145
flags.StringVar(
@@ -151,8 +151,8 @@ func init() {
151151
"This flag deprecates '--shared-vpc-role-arn'.",
152152
)
153153

154-
flags.MarkDeprecated("shared-vpc-role-arn", fmt.Sprintf("'--shared-vpc-role-arn' will be replaced with %s "+
155-
"in future versions of ROSA", hostedZoneRoleArnFlag))
154+
flags.MarkDeprecated("shared-vpc-role-arn", fmt.Sprintf("'--shared-vpc-role-arn' will be replaced with "+
155+
"'--%s' in future versions of ROSA.", hostedZoneRoleArnFlag))
156156

157157
interactive.AddModeFlag(Cmd)
158158
confirm.AddFlag(flags)

cmd/rosa/structure_test/command_args/rosa/create/cluster/command_args.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@
9292
- name: default-ingress-namespace-ownership-policy
9393
- name: private-hosted-zone-id
9494
- name: shared-vpc-role-arn
95+
- name: route53-role-arn
96+
- name: vpc-endpoint-role-arn
97+
- name: hcp-internal-communication-hosted-zone-id
98+
- name: ingress-private-hosted-zone-id
9599
- name: base-domain
96100
- name: additional-compute-security-group-ids
97101
- name: additional-infra-security-group-ids

0 commit comments

Comments
 (0)