/
terraformstate_types.go
114 lines (96 loc) · 4.58 KB
/
terraformstate_types.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type WorkspacesConfig struct {
Name string `json:"name,omitempty"`
Prefix string `json:"prefix,omitempty"`
}
type RemoteConfig struct {
Hostname string `json:"hostname"`
Organization string `json:"organization"`
Token string `json:"token,omitempty"`
Workspaces WorkspacesConfig `json:"workspaces"`
}
type Target struct {
// +kubebuilder:validation:Enum={"configmap","secret"}
Type string `json:"type"`
Name string `json:"name"`
}
type S3Config struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
Region string `json:"region,omitempty"`
AccessKey string `json:"accessKey,omitempty"`
SecretKey string `json:"secretKey,omitempty"`
IAMEndpoint string `json:"iamEndpoint,omitempty"`
MaxRetries int64 `json:"maxRetries,omitempty"`
Profile string `json:"profile,omitempty"`
SharedCredentialsFile string `json:"sharedCredentialsFile,omitempty"`
SkipCredentialsValidation bool `json:"skipCredentialsValidation,omitempty"`
SkipRegionValidation bool `json:"skipRegionValidation,omitempty"`
SkipMetadataAPICheck bool `json:"skipMetadataAPICheck,omitempty"`
STSEndpoint string `json:"stsEndpoint,omitempty"`
Token string `json:"token,omitempty"`
AssumeRoleDurationSeconds int64 `json:"assumeRoleDurationSeconds,omitempty"`
AssumeRolePolicy string `json:"assumeRolePolicy,omitempty"`
AssumeRolePolicyARNs []string `json:"assumeRolePolicyARNs,omitempty"`
AssumeRoleTags map[string]string `json:"assumeRoleTags,omitempty"`
AssumeRoleTransitiveTagKeys []string `json:"assumeRoleTransitiveTagKeys,omitempty"`
ExternalID string `json:"externalID,omitempty"`
RoleARN string `json:"roleARN,omitempty"`
SessionName string `json:"sessionName,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
ForcePathStyle bool `json:"forcePathStyle,omitempty"`
KMSKeyID string `json:"kmsKeyID,omitempty"`
SSECustomerKey string `json:"sseCustomerKey,omitempty"`
WorkspaceKeyPrefix string `json:"workspaceKeyPrefix,omitempty"`
}
type ConsulConfig struct {
Path string `json:"path"`
AccessToken string `json:"accessToken,omitempty"`
Address string `json:"address,omitempty"`
Scheme string `json:"scheme,omitempty"`
Datacenter string `json:"datacenter,omitempty"`
HTTPAuth string `json:"httpAuth,omitempty"`
CAFile string `json:"caFile,omitempty"`
CertFile string `json:"certFile,omitempty"`
KeyFile string `json:"keyFile,omitempty"`
}
type TerraformStateSpec struct {
Type string `json:"type"`
RemoteConfig RemoteConfig `json:"remoteConfig,omitempty"`
S3Config S3Config `json:"s3Config,omitempty"`
ConsulConfig ConsulConfig `json:"consulConfig,omitempty"`
Target Target `json:"target"`
}
type TerraformStateStatus struct{}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=terraformstates,scope=Namespaced,shortName=tfs
type TerraformState struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec TerraformStateSpec `json:"spec,omitempty"`
Status TerraformStateStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
type TerraformStateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []TerraformState `json:"items"`
}
func init() {
SchemeBuilder.Register(&TerraformState{}, &TerraformStateList{})
}