diff --git a/upi/aws/cloudformation/02_cluster_infra.yaml b/upi/aws/cloudformation/02_cluster_infra.yaml index d8c7ab024b..b25babb76a 100644 --- a/upi/aws/cloudformation/02_cluster_infra.yaml +++ b/upi/aws/cloudformation/02_cluster_infra.yaml @@ -208,7 +208,7 @@ Resources: RegisterTargetLambdaIamRole: Type: AWS::IAM::Role Properties: - RoleName: !Join ["-", [!Ref ClusterName, "nlb", "lambda", "role"]] + RoleName: !Join ["-", [!Ref InfrastructureName, "nlb", "lambda", "role"]] AssumeRolePolicyDocument: Version: "2012-10-17" Statement: @@ -220,7 +220,7 @@ Resources: - "sts:AssumeRole" Path: "/" Policies: - - PolicyName: !Join ["-", [!Ref ClusterName, "master", "policy"]] + - PolicyName: !Join ["-", [!Ref InfrastructureName, "master", "policy"]] PolicyDocument: Version: "2012-10-17" Statement: @@ -273,7 +273,7 @@ Resources: RegisterSubnetTagsLambdaIamRole: Type: AWS::IAM::Role Properties: - RoleName: !Join ["-", [!Ref ClusterName, "subnet-tags-lambda-role"]] + RoleName: !Join ["-", [!Ref InfrastructureName, "subnet-tags-lambda-role"]] AssumeRolePolicyDocument: Version: "2012-10-17" Statement: @@ -285,7 +285,7 @@ Resources: - "sts:AssumeRole" Path: "/" Policies: - - PolicyName: !Join ["-", [!Ref ClusterName, "subnet-tagging-policy"]] + - PolicyName: !Join ["-", [!Ref InfrastructureName, "subnet-tagging-policy"]] PolicyDocument: Version: "2012-10-17" Statement: diff --git a/upi/aws/cloudformation/03_cluster_security.yaml b/upi/aws/cloudformation/03_cluster_security.yaml index 3046db1b40..5f7a52331e 100644 --- a/upi/aws/cloudformation/03_cluster_security.yaml +++ b/upi/aws/cloudformation/03_cluster_security.yaml @@ -2,10 +2,12 @@ AWSTemplateFormatVersion: 2010-09-09 Description: Template for Openshift Cluster UPI Security Elements (Security Groups & IAM) Parameters: - ClusterName: + InfrastructureName: AllowedPattern: ^([a-zA-Z][a-zA-Z0-9\-]{0,31})$ - ConstraintDescription: Cluster name must be alphanumeric, start with a letter and a maximum of 32 characters - Description: A short, representative cluster name to use for hostnames, etc. + MaxLength: 32 + MinLength: 1 + ConstraintDescription: Infrastructure name must be alphanumeric, start with a letter and a maximum of 32 characters + Description: A short, unique cluster ID used to tag cloud resources and identify items owned/used by the cluster. Type: String VpcCidr: AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-4]))$ @@ -26,7 +28,7 @@ Metadata: - Label: default: "Cluster Information" Parameters: - - ClusterName + - InfrastructureName - Label: default: "Network Configuration" Parameters: @@ -34,8 +36,8 @@ Metadata: - VpcCidr - PrivateSubnets ParameterLabels: - ClusterName: - default: "Cluster Name" + InfrastructureName: + default: "Infrastructure Name" VpcId: default: "VPC ID" VpcCidr: @@ -47,7 +49,7 @@ Resources: MasterSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: - GroupName: !Join ["-", ["master-sg", !Ref ClusterName]] + GroupName: !Join ["-", ["master-sg", !Ref InfrastructureName]] GroupDescription: Cluster Master Security Group SecurityGroupIngress: - IpProtocol: icmp @@ -71,7 +73,7 @@ Resources: WorkerSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: - GroupName: !Join ["-", ["worker-sg", !Ref ClusterName]] + GroupName: !Join ["-", ["worker-sg", !Ref InfrastructureName]] GroupDescription: Cluster Worker Security Group SecurityGroupIngress: - IpProtocol: icmp @@ -257,7 +259,7 @@ Resources: MasterIamRole: Type: AWS::IAM::Role Properties: - RoleName: !Join ["-", [!Ref ClusterName, "master", "role"]] + RoleName: !Join ["-", [!Ref InfrastructureName, "master", "role"]] AssumeRolePolicyDocument: Version: "2012-10-17" Statement: @@ -269,7 +271,7 @@ Resources: - "sts:AssumeRole" Path: "/" Policies: - - PolicyName: !Join ["-", [!Ref ClusterName, "master", "policy"]] + - PolicyName: !Join ["-", [!Ref InfrastructureName, "master", "policy"]] PolicyDocument: Version: "2012-10-17" Statement: @@ -296,7 +298,7 @@ Resources: WorkerIamRole: Type: AWS::IAM::Role Properties: - RoleName: !Join ["-", [!Ref ClusterName, "worker", "role"]] + RoleName: !Join ["-", [!Ref InfrastructureName, "worker", "role"]] AssumeRolePolicyDocument: Version: "2012-10-17" Statement: @@ -308,7 +310,7 @@ Resources: - "sts:AssumeRole" Path: "/" Policies: - - PolicyName: !Join ["-", [!Ref ClusterName, "worker", "policy"]] + - PolicyName: !Join ["-", [!Ref InfrastructureName, "worker", "policy"]] PolicyDocument: Version: "2012-10-17" Statement: diff --git a/upi/aws/cloudformation/04_cluster_bootstrap.yaml b/upi/aws/cloudformation/04_cluster_bootstrap.yaml index 9b5e8e47a9..b9af63c4a2 100644 --- a/upi/aws/cloudformation/04_cluster_bootstrap.yaml +++ b/upi/aws/cloudformation/04_cluster_bootstrap.yaml @@ -2,10 +2,12 @@ AWSTemplateFormatVersion: 2010-09-09 Description: Template for Openshift Cluster UPI Bootstrap (EC2 Instance, Security Groups and IAM) Parameters: - ClusterName: + InfrastructureName: AllowedPattern: ^([a-zA-Z][a-zA-Z0-9\-]{0,31})$ - ConstraintDescription: Cluster name must be alphanumeric, start with a letter and a maximum of 32 characters - Description: A short, representative cluster name to use for hostnames, etc. + MaxLength: 32 + MinLength: 1 + ConstraintDescription: Infrastructure name must be alphanumeric, start with a letter and a maximum of 32 characters + Description: A short, unique cluster ID used to tag cloud resources and identify items owned/used by the cluster. Type: String RhcosAmi: Description: Current RHEL CoreOS AMI to use for boostrap @@ -55,7 +57,7 @@ Metadata: - Label: default: "Cluster Information" Parameters: - - ClusterName + - InfrastructureName - Label: default: "Host Information" Parameters: @@ -77,8 +79,8 @@ Metadata: - InternalApiTargetGroupArn - InternalServiceTargetGroupArn ParameterLabels: - ClusterName: - default: "Cluster Name" + InfrastructureName: + default: "Infrastructure Name" VpcId: default: "VPC ID" AllowedBootstrapSshCidr: @@ -101,7 +103,7 @@ Resources: BootstrapIamRole: Type: AWS::IAM::Role Properties: - RoleName: !Join ["-", [!Ref ClusterName, "bootstrap", "role"]] + RoleName: !Join ["-", [!Ref InfrastructureName, "bootstrap", "role"]] AssumeRolePolicyDocument: Version: "2012-10-17" Statement: @@ -113,7 +115,7 @@ Resources: - "sts:AssumeRole" Path: "/" Policies: - - PolicyName: !Join ["-", [!Ref ClusterName, "bootstrap", "policy"]] + - PolicyName: !Join ["-", [!Ref InfrastructureName, "bootstrap", "policy"]] PolicyDocument: Version: "2012-10-17" Statement: @@ -140,7 +142,7 @@ Resources: BootstrapSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: - GroupName: !Join ["-", ["bootstrap-sg", !Ref ClusterName]] + GroupName: !Join ["-", ["bootstrap-sg", !Ref InfrastructureName]] GroupDescription: Cluster Bootstrap Security Group SecurityGroupIngress: - IpProtocol: tcp @@ -174,8 +176,8 @@ Resources: } Tags: - Key: "Name" - Value: !Join ["-", [!Ref ClusterName, "bootstrap"]] - - Key: !Join ["", ["kubernetes.io/cluster/", !Ref ClusterName]] + Value: !Join ["-", [!Ref InfrastructureName, "bootstrap"]] + - Key: !Join ["", ["kubernetes.io/cluster/", !Ref InfrastructureName]] Value: "Owned" RegisterBootstrapApiTarget: diff --git a/upi/aws/cloudformation/05_cluster_master_nodes.yaml b/upi/aws/cloudformation/05_cluster_master_nodes.yaml index aa0c96e3a2..a509e1e675 100644 --- a/upi/aws/cloudformation/05_cluster_master_nodes.yaml +++ b/upi/aws/cloudformation/05_cluster_master_nodes.yaml @@ -2,10 +2,12 @@ AWSTemplateFormatVersion: 2010-09-09 Description: Template for Openshift Cluster UPI Node Launch (EC2 master instances) Parameters: - ClusterName: + InfrastructureName: AllowedPattern: ^([a-zA-Z][a-zA-Z0-9\-]{0,31})$ - ConstraintDescription: Cluster name must be alphanumeric, start with a letter and a maximum of 32 characters - Description: A short, representative cluster name to use for hostnames, etc. + MaxLength: 32 + MinLength: 1 + ConstraintDescription: Infrastructure name must be alphanumeric, start with a letter and a maximum of 32 characters + Description: A short, unique cluster ID used to tag cloud resources and identify items owned/used by the cluster. Type: String RhcosAmi: Description: Current RHEL CoreOS AMI to use for boostrap @@ -91,6 +93,7 @@ Metadata: default: "Cluster Information" Parameters: - ClusterName + - InfrastructureName - Label: default: "Host Information" Parameters: @@ -125,6 +128,8 @@ Metadata: ParameterLabels: ClusterName: default: "Cluster Name" + InfrastructureName: + default: "Infrastructure Name" VpcId: default: "VPC ID" Master0Subnet: @@ -180,11 +185,11 @@ Resources: } Tags: - Key: "Name" - Value: !Join ["-", [!Ref ClusterName, "master", "0"]] - - Key: !Join ["", ["kubernetes.io/cluster/", !Ref ClusterName]] + Value: !Join ["-", [!Ref InfrastructureName, "master", "0"]] + - Key: !Join ["", ["kubernetes.io/cluster/", !Ref InfrastructureName]] Value: "owned" - Key: "clusterid" - Value: !Ref ClusterName + Value: !Ref InfrastructureName RegisterMaster0: Condition: DoRegistration @@ -231,11 +236,11 @@ Resources: } Tags: - Key: "Name" - Value: !Join ["-", [!Ref ClusterName, "master", "1"]] - - Key: !Join ["", ["kubernetes.io/cluster/", !Ref ClusterName]] + Value: !Join ["-", [!Ref InfrastructureName, "master", "1"]] + - Key: !Join ["", ["kubernetes.io/cluster/", !Ref InfrastructureName]] Value: "owned" - Key: "clusterid" - Value: !Ref ClusterName + Value: !Ref InfrastructureName RegisterMaster1: Condition: DoRegistration @@ -282,11 +287,11 @@ Resources: } Tags: - Key: "Name" - Value: !Join ["-", [!Ref ClusterName, "master", "2"]] - - Key: !Join ["", ["kubernetes.io/cluster/", !Ref ClusterName]] + Value: !Join ["-", [!Ref InfrastructureName, "master", "2"]] + - Key: !Join ["", ["kubernetes.io/cluster/", !Ref InfrastructureName]] Value: "owned" - Key: "clusterid" - Value: !Ref ClusterName + Value: !Ref InfrastructureName RegisterMaster2: Condition: DoRegistration diff --git a/upi/aws/cloudformation/06_cluster_worker_node.yaml b/upi/aws/cloudformation/06_cluster_worker_node.yaml index 91a456999a..568f5f238e 100644 --- a/upi/aws/cloudformation/06_cluster_worker_node.yaml +++ b/upi/aws/cloudformation/06_cluster_worker_node.yaml @@ -2,10 +2,12 @@ AWSTemplateFormatVersion: 2010-09-09 Description: Template for Openshift Cluster UPI Node Launch (EC2 worker instance) Parameters: - ClusterName: + InfrastructureName: AllowedPattern: ^([a-zA-Z][a-zA-Z0-9\-]{0,31})$ - ConstraintDescription: Cluster name must be alphanumeric, start with a letter and a maximum of 32 characters - Description: A short, representative cluster name to use for hostnames, etc. + MaxLength: 32 + MinLength: 1 + ConstraintDescription: Infrastructure name must be alphanumeric, start with a letter and a maximum of 32 characters + Description: A short, unique cluster ID used to tag cloud resources and identify items owned/used by the cluster. Type: String RhcosAmi: Description: Current RHEL CoreOS AMI to use for boostrap @@ -56,7 +58,7 @@ Metadata: - Label: default: "Cluster Information" Parameters: - - ClusterName + - InfrastructureName - Label: default: "Host Information" Parameters: @@ -72,8 +74,8 @@ Metadata: - VpcId - WorkerSubnet ParameterLabels: - ClusterName: - default: "Cluster Name" + InfrastructureName: + default: "Infrastructure Name" VpcId: default: "VPC ID" WorkerSubnet: @@ -113,8 +115,8 @@ Resources: } Tags: - Key: "Name" - Value: !Join ["-", [!Ref ClusterName, "worker"]] - - Key: !Join ["", ["kubernetes.io/cluster/", !Ref ClusterName]] + Value: !Join ["-", [!Ref InfrastructureName, "worker"]] + - Key: !Join ["", ["kubernetes.io/cluster/", !Ref InfrastructureName]] Value: "owned" - Key: "clusterid" - Value: !Ref ClusterName + Value: !Ref InfrastructureName