github.com/openshift/installer@v1.4.17/pkg/types/aws/platform.go (about) 1 package aws 2 3 import ( 4 "github.com/aws/aws-sdk-go/aws/endpoints" 5 6 configv1 "github.com/openshift/api/config/v1" 7 ) 8 9 const ( 10 // VolumeTypeGp2 is the type of EBS volume for General Purpose SSD gp2. 11 VolumeTypeGp2 = "gp2" 12 // VolumeTypeGp3 is the type of EBS volume for General Purpose SSD gp3. 13 VolumeTypeGp3 = "gp3" 14 ) 15 16 // Platform stores all the global configuration that all machinesets 17 // use. 18 type Platform struct { 19 // The field is deprecated. AMIID is the AMI that should be used to boot 20 // machines for the cluster. If set, the AMI should belong to the same 21 // region as the cluster. 22 // 23 // +optional 24 AMIID string `json:"amiID,omitempty"` 25 26 // Region specifies the AWS region where the cluster will be created. 27 Region string `json:"region"` 28 29 // Subnets specifies existing subnets (by ID) where cluster 30 // resources will be created. Leave unset to have the installer 31 // create subnets in a new VPC on your behalf. 32 // 33 // +optional 34 Subnets []string `json:"subnets,omitempty"` 35 36 // HostedZone is the ID of an existing hosted zone into which to add DNS 37 // records for the cluster's internal API. An existing hosted zone can 38 // only be used when also using existing subnets. The hosted zone must be 39 // associated with the VPC containing the subnets. 40 // Leave the hosted zone unset to have the installer create the hosted zone 41 // on your behalf. 42 // +optional 43 HostedZone string `json:"hostedZone,omitempty"` 44 45 // HostedZoneRole is the ARN of an IAM role to be assumed when performing 46 // operations on the provided HostedZone. HostedZoneRole can be used 47 // in a shared VPC scenario when the private hosted zone belongs to a 48 // different account than the rest of the cluster resources. 49 // If HostedZoneRole is set, HostedZone must also be set. 50 // 51 // +optional 52 HostedZoneRole string `json:"hostedZoneRole,omitempty"` 53 54 // UserTags additional keys and values that the installer will add 55 // as tags to all resources that it creates. Resources created by the 56 // cluster itself may not include these tags. 57 // +optional 58 UserTags map[string]string `json:"userTags,omitempty"` 59 60 // ServiceEndpoints list contains custom endpoints which will override default 61 // service endpoint of AWS Services. 62 // There must be only one ServiceEndpoint for a service. 63 // +optional 64 ServiceEndpoints []ServiceEndpoint `json:"serviceEndpoints,omitempty"` 65 66 // DefaultMachinePlatform is the default configuration used when 67 // installing on AWS for machine pools which do not define their own 68 // platform configuration. 69 // +optional 70 DefaultMachinePlatform *MachinePool `json:"defaultMachinePlatform,omitempty"` 71 72 // The field is deprecated. ExperimentalPropagateUserTags is an experimental 73 // flag that directs in-cluster operators to include the specified 74 // user tags in the tags of the AWS resources that the operators create. 75 // +optional 76 ExperimentalPropagateUserTag *bool `json:"experimentalPropagateUserTags,omitempty"` 77 78 // PropagateUserTags is a flag that directs in-cluster operators 79 // to include the specified user tags in the tags of the 80 // AWS resources that the operators create. 81 // +optional 82 PropagateUserTag bool `json:"propagateUserTags,omitempty"` 83 84 // LBType is an optional field to specify a load balancer type. 85 // When this field is specified, all ingresscontrollers (including the 86 // default ingresscontroller) will be created using the specified load-balancer 87 // type by default. 88 // 89 // Following are the accepted values: 90 // 91 // * "Classic": A Classic Load Balancer that makes routing decisions at 92 // either the transport layer (TCP/SSL) or the application layer 93 // (HTTP/HTTPS). See the following for additional details: 94 // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#clb 95 // 96 // * "NLB": A Network Load Balancer that makes routing decisions at the 97 // transport layer (TCP/SSL). See the following for additional details: 98 // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#nlb 99 // 100 // If this field is not set explicitly, it defaults to "Classic". This 101 // default is subject to change over time. 102 // 103 // +optional 104 LBType configv1.AWSLBType `json:"lbType,omitempty"` 105 106 // PreserveBootstrapIgnition is deprecated. Use bestEffortDeleteIgnition instead. 107 // +optional 108 PreserveBootstrapIgnition bool `json:"preserveBootstrapIgnition,omitempty"` 109 110 // BestEffortDeleteIgnition is an optional field that can be used to ignore errors from S3 deletion of ignition 111 // objects during cluster bootstrap. The default behavior is to fail the installation if ignition objects cannot be 112 // deleted. Enable this functionality when there are known reasons disallowing their deletion. 113 // +optional 114 BestEffortDeleteIgnition bool `json:"bestEffortDeleteIgnition,omitempty"` 115 116 // PublicIpv4Pool is an optional field that can be used to tell the installation process to use 117 // Public IPv4 address that you bring to your AWS account with BYOIP. 118 // +optional 119 PublicIpv4Pool string `json:"publicIpv4Pool,omitempty"` 120 } 121 122 // ServiceEndpoint store the configuration for services to 123 // override existing defaults of AWS Services. 124 type ServiceEndpoint struct { 125 // Name is the name of the AWS service. 126 // This must be provided and cannot be empty. 127 Name string `json:"name"` 128 129 // URL is fully qualified URI with scheme https, that overrides the default generated 130 // endpoint for a client. 131 // This must be provided and cannot be empty. 132 // 133 // +kubebuilder:validation:Pattern=`^https://` 134 URL string `json:"url"` 135 } 136 137 // IsSecretRegion returns true if the region is part of either the ISO or ISOB partitions. 138 func IsSecretRegion(region string) bool { 139 partition, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), region) 140 if !ok { 141 return false 142 } 143 switch partition.ID() { 144 case endpoints.AwsIsoPartitionID, endpoints.AwsIsoBPartitionID: 145 return true 146 } 147 return false 148 }