/
parameters.go
91 lines (82 loc) · 4.42 KB
/
parameters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package eksconfig
// EnvironmentVariablePrefixParameters is the environment variable prefix used for "eksconfig".
const EnvironmentVariablePrefixParameters = AWS_K8S_TESTER_EKS_PREFIX + "PARAMETERS_"
// Parameters defines parameters for EKS "cluster" creation.
type Parameters struct {
// RoleName is the name of cluster role.
RoleName string `json:"role-name"`
// RoleCreate is true to auto-create and delete cluster role.
RoleCreate bool `json:"role-create"`
// RoleARN is the role ARN that EKS uses to create AWS resources for Kubernetes.
// By default, it's empty which triggers tester to create one.
RoleARN string `json:"role-arn"`
// RoleServicePrincipals is the EKS Role Service Principals
RoleServicePrincipals []string `json:"role-service-principals"`
// RoleManagedPolicyARNs is EKS Role managed policy ARNs.
RoleManagedPolicyARNs []string `json:"role-managed-policy-arns"`
RoleCFNStackID string `json:"role-cfn-stack-id" read-only:"true"`
// Tags defines EKS create cluster tags.
Tags map[string]string `json:"tags"`
// RequestHeaderKey defines EKS create cluster request header key.
RequestHeaderKey string `json:"request-header-key"`
// RequestHeaderValue defines EKS create cluster request header value.
RequestHeaderValue string `json:"request-header-value"`
// ResolverURL defines an AWS resolver endpoint for EKS API.
// Must be left empty to use production EKS service.
ResolverURL string `json:"resolver-url"`
// SigningName is the EKS create request signing name.
SigningName string `json:"signing-name"`
// VPCCreate is true to auto-create and delete VPC.
VPCCreate bool `json:"vpc-create"`
// VPCID is the VPC ID for cluster creation.
// If not empty, VPC is reused and not deleted.
// If empty, VPC is created anew and deleted on cluster deletion.
VPCID string `json:"vpc-id"`
VPCCFNStackID string `json:"vpc-cfn-stack-id" read-only:"true"`
// VpcCIDR is the IP range (CIDR notation) for VPC, must be a valid private
// (RFC 1918) CIDR range.
VPCCIDR string `json:"vpc-cidr,omitempty"`
// PublicSubnetCIDR1 is the CIDR Block for subnet 1 within the VPC.
PublicSubnetCIDR1 string `json:"public-subnet-cidr-1,omitempty"`
// PublicSubnetCIDR2 is the CIDR Block for subnet 2 within the VPC.
PublicSubnetCIDR2 string `json:"public-subnet-cidr-2,omitempty"`
// PublicSubnetCIDR3 is the CIDR Block for subnet 3 within the VPC.
PublicSubnetCIDR3 string `json:"public-subnet-cidr-3,omitempty"`
// PrivateSubnetCIDR1 is the CIDR Block for subnet 1 within the VPC.
PrivateSubnetCIDR1 string `json:"private-subnet-cidr-1,omitempty"`
// PrivateSubnetCIDR2 is the CIDR Block for subnet 2 within the VPC.
PrivateSubnetCIDR2 string `json:"private-subnet-cidr-2,omitempty"`
// PublicSubnetIDs is the list of all public subnets in the VPC.
PublicSubnetIDs []string `json:"public-subnet-ids" read-only:"true"`
// PrivateSubnetIDs is the list of all private subnets in the VPC.
PrivateSubnetIDs []string `json:"private-subnet-ids" read-only:"true"`
// DHCPOptionsDomainName is used to complete unqualified DNS hostnames for VPC.
// ref. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-dhcp-options.html
// ref. https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html
DHCPOptionsDomainName string `json:"dhcp-options-domain-name"`
// DHCPOptionsDomainNameServers is a list of strings.
// The IPv4 addresses of up to four domain name servers, or AmazonProvidedDNS, for VPC.
// ref. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-dhcp-options.html
// ref. https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html
DHCPOptionsDomainNameServers []string `json:"dhcp-options-domain-name-servers"`
// Version is the version of EKS Kubernetes "cluster".
// If empty, set default version.
Version string `json:"version"`
VersionValue float64 `json:"version-value" read-only:"true"`
// EncryptionCMKCreate is true to auto-create and delete KMS CMK
// for encryption feature.
EncryptionCMKCreate bool `json:"encryption-cmk-create"`
// EncryptionCMKARN is the KMS CMK ARN for encryption feature.
// If not empty, the cluster is created with encryption feature
// enabled.
EncryptionCMKARN string `json:"encryption-cmk-arn"`
}
func getDefaultParameters() *Parameters {
return &Parameters{
RoleCreate: true,
VPCCreate: true,
SigningName: "eks",
Version: "1.16",
EncryptionCMKCreate: true,
}
}