Merge pull request #13029 from rifelpet/remove-tf-json

Remove TerraformJSON feature flag
This commit is contained in:
Kubernetes Prow Robot 2021-12-25 06:33:15 -08:00 committed by GitHub
commit 13243b5add
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 503 additions and 645 deletions

View File

@ -17,6 +17,5 @@ The following experimental features are currently available:
* `+SpotinstHybrid` - Toggles between hybrid and full instance group implementations
* `-SpotinstController` - Toggles the installation of the Spot controller addon off
* `+SkipEtcdVersionCheck` - Bypasses the check that etcd-manager is using a supported etcd version
* `+TerraformJSON` - Produce kubernetes.tf.json file instead of writing HCLv2 syntax. Can be consumed by terraform 0.12+
* `+VFSVaultSupport` - Enables setting Vault as secret/keystore
* `+APIServerNodes` - Enables support for dedicated API server nodes

View File

@ -9,13 +9,13 @@ The Terraform output should be reasonably stable (i.e. the text files should onl
Note that if you modify the Terraform files that kOps spits out, it will override your changes with the configuration state defined by its own configs. In other terms, kOps's own state is the ultimate source of truth (as far as kOps is concerned), and Terraform is a representation of that state for your convenience.
### Terraform Version Compatibility
| kOps Version | Terraform Version | Feature Flag Notes |
|--------------|-------------------|--------------------|
| >= 1.19 | >= 0.12.26, >= 0.13 | HCL2 supported by default <br>`KOPS_FEATURE_FLAGS=Terraform-0.12` is now deprecated |
| >= 1.18 | >= 0.12 | HCL2 supported by default |
| >= 1.18 | < 0.12 | `KOPS_FEATURE_FLAGS=-Terraform-0.12` |
| >= 1.17 | >= 0.12 | `KOPS_FEATURE_FLAGS=TerraformJSON` outputs JSON |
| <= 1.17 | < 0.12 | Supported by default |
| kOps Version | Terraform Version | Feature Flag Notes |
|-----------------|-------------------|--------------------|
| >= 1.19 | >= 0.12.26, >= 0.13 | HCL2 supported by default <br>`KOPS_FEATURE_FLAGS=Terraform-0.12` is now deprecated |
| >= 1.18 | >= 0.12 | HCL2 supported by default |
| >= 1.18 | < 0.12 | `KOPS_FEATURE_FLAGS=-Terraform-0.12` |
| >= 1.17, < 1.23 | >= 0.12 | `KOPS_FEATURE_FLAGS=TerraformJSON` outputs JSON |
| <= 1.17 | < 0.12 | Supported by default |
### Using Terraform
@ -137,14 +137,3 @@ Ps: You don't have to `kops delete cluster` if you just want to recreate from sc
Changes made with `kops edit` (like enabling RBAC and / or feature gates) will result in changes to the LaunchTemplate of your cluster nodes. After a `terraform apply`, they won't be applied right away since terraform will not launch new instances as part of that.
To see your changes applied to the cluster you'll also need to run `kops rolling-update` after running `terraform apply`. This will ensure that all nodes' changes have the desired settings configured with `kops edit`.
#### Terraform JSON output
With terraform 0.12 JSON is now officially supported as configuration language. To enable JSON output instead of HCLv2 output you need to enable it through a feature flag.
```
export KOPS_FEATURE_FLAGS=TerraformJSON
kops update cluster .....
```
This is an alternative to of using terraforms own configuration syntax HCL. Be sure to delete the existing kubernetes.tf file. Terraform will otherwise use both and then complain.

View File

@ -72,8 +72,6 @@ var (
VPCSkipEnableDNSSupport = new("VPCSkipEnableDNSSupport", Bool(false))
// SkipEtcdVersionCheck will bypass the check that etcd-manager is using a supported etcd version
SkipEtcdVersionCheck = new("SkipEtcdVersionCheck", Bool(false))
// TerraformJSON outputs terraform in JSON instead of hcl output. JSON output can be also parsed by terraform 0.12
TerraformJSON = new("TerraformJSON", Bool(false))
// ClusterAddons activates experimental cluster-addons support
ClusterAddons = new("ClusterAddons", Bool(false))
// Azure toggles the Azure support.

View File

@ -819,74 +819,74 @@ func (e *AutoscalingGroup) getTGsToDetach(currentTGs []*TargetGroup) []*string {
}
type terraformASGTag struct {
Key *string `json:"key" cty:"key"`
Value *string `json:"value" cty:"value"`
PropagateAtLaunch *bool `json:"propagate_at_launch" cty:"propagate_at_launch"`
Key *string `cty:"key"`
Value *string `cty:"value"`
PropagateAtLaunch *bool `cty:"propagate_at_launch"`
}
type terraformAutoscalingLaunchTemplateSpecification struct {
// LaunchTemplateID is the ID of the template to use.
LaunchTemplateID *terraformWriter.Literal `json:"id,omitempty" cty:"id"`
LaunchTemplateID *terraformWriter.Literal `cty:"id"`
// Version is the version of the Launch Template to use.
Version *terraformWriter.Literal `json:"version,omitempty" cty:"version"`
Version *terraformWriter.Literal `cty:"version"`
}
type terraformAutoscalingMixedInstancesPolicyLaunchTemplateSpecification struct {
// LaunchTemplateID is the ID of the template to use
LaunchTemplateID *terraformWriter.Literal `json:"launch_template_id,omitempty" cty:"launch_template_id"`
LaunchTemplateID *terraformWriter.Literal `cty:"launch_template_id"`
// Version is the version of the Launch Template to use
Version *terraformWriter.Literal `json:"version,omitempty" cty:"version"`
Version *terraformWriter.Literal `cty:"version"`
}
type terraformAutoscalingMixedInstancesPolicyLaunchTemplateOverride struct {
// InstanceType is the instance to use
InstanceType *string `json:"instance_type,omitempty" cty:"instance_type"`
InstanceType *string `cty:"instance_type"`
}
type terraformAutoscalingMixedInstancesPolicyLaunchTemplate struct {
// LaunchTemplateSpecification is the definition for a LT
LaunchTemplateSpecification []*terraformAutoscalingMixedInstancesPolicyLaunchTemplateSpecification `json:"launch_template_specification,omitempty" cty:"launch_template_specification"`
LaunchTemplateSpecification []*terraformAutoscalingMixedInstancesPolicyLaunchTemplateSpecification `cty:"launch_template_specification"`
// Override the is machine type override
Override []*terraformAutoscalingMixedInstancesPolicyLaunchTemplateOverride `json:"override,omitempty" cty:"override"`
Override []*terraformAutoscalingMixedInstancesPolicyLaunchTemplateOverride `cty:"override"`
}
type terraformAutoscalingInstanceDistribution struct {
// OnDemandAllocationStrategy
OnDemandAllocationStrategy *string `json:"on_demand_allocation_strategy,omitempty" cty:"on_demand_allocation_strategy"`
OnDemandAllocationStrategy *string `cty:"on_demand_allocation_strategy"`
// OnDemandBaseCapacity is the base ondemand requirement
OnDemandBaseCapacity *int64 `json:"on_demand_base_capacity,omitempty" cty:"on_demand_base_capacity"`
OnDemandBaseCapacity *int64 `cty:"on_demand_base_capacity"`
// OnDemandPercentageAboveBaseCapacity is the percentage above base for on-demand instances
OnDemandPercentageAboveBaseCapacity *int64 `json:"on_demand_percentage_above_base_capacity,omitempty" cty:"on_demand_percentage_above_base_capacity"`
OnDemandPercentageAboveBaseCapacity *int64 `cty:"on_demand_percentage_above_base_capacity"`
// SpotAllocationStrategy is the spot allocation stratergy
SpotAllocationStrategy *string `json:"spot_allocation_strategy,omitempty" cty:"spot_allocation_strategy"`
SpotAllocationStrategy *string `cty:"spot_allocation_strategy"`
// SpotInstancePool is the number of pools
SpotInstancePool *int64 `json:"spot_instance_pools,omitempty" cty:"spot_instance_pools"`
SpotInstancePool *int64 `cty:"spot_instance_pools"`
// SpotMaxPrice is the max bid on spot instance, defaults to demand value
SpotMaxPrice *string `json:"spot_max_price,omitempty" cty:"spot_max_price"`
SpotMaxPrice *string `cty:"spot_max_price"`
}
type terraformMixedInstancesPolicy struct {
// LaunchTemplate is the launch template spec
LaunchTemplate []*terraformAutoscalingMixedInstancesPolicyLaunchTemplate `json:"launch_template,omitempty" cty:"launch_template"`
LaunchTemplate []*terraformAutoscalingMixedInstancesPolicyLaunchTemplate `cty:"launch_template"`
// InstanceDistribution is the distribution strategy
InstanceDistribution []*terraformAutoscalingInstanceDistribution `json:"instances_distribution,omitempty" cty:"instances_distribution"`
InstanceDistribution []*terraformAutoscalingInstanceDistribution `cty:"instances_distribution"`
}
type terraformAutoscalingGroup struct {
Name *string `json:"name,omitempty" cty:"name"`
LaunchConfigurationName *terraformWriter.Literal `json:"launch_configuration,omitempty" cty:"launch_configuration"`
LaunchTemplate *terraformAutoscalingLaunchTemplateSpecification `json:"launch_template,omitempty" cty:"launch_template"`
MaxSize *int64 `json:"max_size,omitempty" cty:"max_size"`
MinSize *int64 `json:"min_size,omitempty" cty:"min_size"`
MixedInstancesPolicy []*terraformMixedInstancesPolicy `json:"mixed_instances_policy,omitempty" cty:"mixed_instances_policy"`
VPCZoneIdentifier []*terraformWriter.Literal `json:"vpc_zone_identifier,omitempty" cty:"vpc_zone_identifier"`
Tags []*terraformASGTag `json:"tag,omitempty" cty:"tag"`
MetricsGranularity *string `json:"metrics_granularity,omitempty" cty:"metrics_granularity"`
EnabledMetrics []*string `json:"enabled_metrics,omitempty" cty:"enabled_metrics"`
SuspendedProcesses []*string `json:"suspended_processes,omitempty" cty:"suspended_processes"`
InstanceProtection *bool `json:"protect_from_scale_in,omitempty" cty:"protect_from_scale_in"`
LoadBalancers []*terraformWriter.Literal `json:"load_balancers,omitempty" cty:"load_balancers"`
TargetGroupARNs []*terraformWriter.Literal `json:"target_group_arns,omitempty" cty:"target_group_arns"`
Name *string `cty:"name"`
LaunchConfigurationName *terraformWriter.Literal `cty:"launch_configuration"`
LaunchTemplate *terraformAutoscalingLaunchTemplateSpecification `cty:"launch_template"`
MaxSize *int64 `cty:"max_size"`
MinSize *int64 `cty:"min_size"`
MixedInstancesPolicy []*terraformMixedInstancesPolicy `cty:"mixed_instances_policy"`
VPCZoneIdentifier []*terraformWriter.Literal `cty:"vpc_zone_identifier"`
Tags []*terraformASGTag `cty:"tag"`
MetricsGranularity *string `cty:"metrics_granularity"`
EnabledMetrics []*string `cty:"enabled_metrics"`
SuspendedProcesses []*string `cty:"suspended_processes"`
InstanceProtection *bool `cty:"protect_from_scale_in"`
LoadBalancers []*terraformWriter.Literal `cty:"load_balancers"`
TargetGroupARNs []*terraformWriter.Literal `cty:"target_group_arns"`
}
// RenderTerraform is responsible for rendering the terraform codebase

View File

@ -121,11 +121,11 @@ func (*AutoscalingLifecycleHook) RenderAWS(t *awsup.AWSAPITarget, a, e, changes
}
type terraformASGLifecycleHook struct {
Name *string `json:"name" cty:"name"`
AutoScalingGroupName *terraformWriter.Literal `json:"autoscaling_group_name" cty:"autoscaling_group_name"`
DefaultResult *string `json:"default_result" cty:"default_result"`
HeartbeatTimeout *int64 `json:"heartbeat_timeout" cty:"heartbeat_timeout"`
LifecycleTransition *string `json:"lifecycle_transition" cty:"lifecycle_transition"`
Name *string `cty:"name"`
AutoScalingGroupName *terraformWriter.Literal `cty:"autoscaling_group_name"`
DefaultResult *string `cty:"default_result"`
HeartbeatTimeout *int64 `cty:"heartbeat_timeout"`
LifecycleTransition *string `cty:"lifecycle_transition"`
}
func (_ *AutoscalingLifecycleHook) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *AutoscalingLifecycleHook) error {

View File

@ -614,39 +614,39 @@ func (a OrderLoadBalancersByName) Less(i, j int) bool {
}
type terraformLoadBalancer struct {
LoadBalancerName *string `json:"name" cty:"name"`
Listener []*terraformLoadBalancerListener `json:"listener" cty:"listener"`
SecurityGroups []*terraformWriter.Literal `json:"security_groups" cty:"security_groups"`
Subnets []*terraformWriter.Literal `json:"subnets" cty:"subnets"`
Internal *bool `json:"internal,omitempty" cty:"internal"`
LoadBalancerName *string `cty:"name"`
Listener []*terraformLoadBalancerListener `cty:"listener"`
SecurityGroups []*terraformWriter.Literal `cty:"security_groups"`
Subnets []*terraformWriter.Literal `cty:"subnets"`
Internal *bool `cty:"internal"`
HealthCheck *terraformLoadBalancerHealthCheck `json:"health_check,omitempty" cty:"health_check"`
AccessLog *terraformLoadBalancerAccessLog `json:"access_logs,omitempty" cty:"access_logs"`
HealthCheck *terraformLoadBalancerHealthCheck `cty:"health_check"`
AccessLog *terraformLoadBalancerAccessLog `cty:"access_logs"`
ConnectionDraining *bool `json:"connection_draining,omitempty" cty:"connection_draining"`
ConnectionDrainingTimeout *int64 `json:"connection_draining_timeout,omitempty" cty:"connection_draining_timeout"`
ConnectionDraining *bool `cty:"connection_draining"`
ConnectionDrainingTimeout *int64 `cty:"connection_draining_timeout"`
CrossZoneLoadBalancing *bool `json:"cross_zone_load_balancing,omitempty" cty:"cross_zone_load_balancing"`
CrossZoneLoadBalancing *bool `cty:"cross_zone_load_balancing"`
IdleTimeout *int64 `json:"idle_timeout,omitempty" cty:"idle_timeout"`
IdleTimeout *int64 `cty:"idle_timeout"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
Tags map[string]string `cty:"tags"`
}
type terraformLoadBalancerListener struct {
InstancePort int `json:"instance_port" cty:"instance_port"`
InstanceProtocol string `json:"instance_protocol" cty:"instance_protocol"`
LBPort int64 `json:"lb_port" cty:"lb_port"`
LBProtocol string `json:"lb_protocol" cty:"lb_protocol"`
SSLCertificateID *string `json:"ssl_certificate_id,omitempty" cty:"ssl_certificate_id"`
InstancePort int `cty:"instance_port"`
InstanceProtocol string `cty:"instance_protocol"`
LBPort int64 `cty:"lb_port"`
LBProtocol string `cty:"lb_protocol"`
SSLCertificateID *string `cty:"ssl_certificate_id"`
}
type terraformLoadBalancerHealthCheck struct {
Target *string `json:"target" cty:"target"`
HealthyThreshold *int64 `json:"healthy_threshold" cty:"healthy_threshold"`
UnhealthyThreshold *int64 `json:"unhealthy_threshold" cty:"unhealthy_threshold"`
Interval *int64 `json:"interval" cty:"interval"`
Timeout *int64 `json:"timeout" cty:"timeout"`
Target *string `cty:"target"`
HealthyThreshold *int64 `cty:"healthy_threshold"`
UnhealthyThreshold *int64 `cty:"unhealthy_threshold"`
Interval *int64 `cty:"interval"`
Timeout *int64 `cty:"timeout"`
}
func (_ *ClassicLoadBalancer) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *ClassicLoadBalancer) error {

View File

@ -38,10 +38,10 @@ func (_ *ClassicLoadBalancerAccessLog) GetDependencies(tasks map[string]fi.Task)
}
type terraformLoadBalancerAccessLog struct {
EmitInterval *int64 `json:"interval,omitempty" cty:"interval"`
Enabled *bool `json:"enabled,omitempty" cty:"enabled"`
S3BucketName *string `json:"bucket,omitempty" cty:"bucket"`
S3BucketPrefix *string `json:"bucket_prefix,omitempty" cty:"bucket_prefix"`
EmitInterval *int64 `cty:"interval"`
Enabled *bool `cty:"enabled"`
S3BucketName *string `cty:"bucket"`
S3BucketPrefix *string `cty:"bucket_prefix"`
}
type cloudformationClassicLoadBalancerAccessLog struct {

View File

@ -171,9 +171,9 @@ func (_ *DHCPOptions) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *DHCPOption
}
type terraformDHCPOptions struct {
DomainName *string `json:"domain_name,omitempty" cty:"domain_name"`
DomainNameServers []string `json:"domain_name_servers,omitempty" cty:"domain_name_servers"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
DomainName *string `cty:"domain_name"`
DomainNameServers []string `cty:"domain_name_servers"`
Tags map[string]string `cty:"tags"`
}
func (_ *DHCPOptions) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *DHCPOptions) error {

View File

@ -251,20 +251,20 @@ func (_ *DNSName) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *DNSName) error
}
type terraformRoute53Record struct {
Name *string `json:"name" cty:"name"`
Type *string `json:"type" cty:"type"`
TTL *string `json:"ttl,omitempty" cty:"ttl"`
Records []string `json:"records,omitempty" cty:"records"`
Name *string `cty:"name"`
Type *string `cty:"type"`
TTL *string `cty:"ttl"`
Records []string `cty:"records"`
Alias *terraformAlias `json:"alias,omitempty" cty:"alias"`
ZoneID *terraformWriter.Literal `json:"zone_id" cty:"zone_id"`
Alias *terraformAlias `cty:"alias"`
ZoneID *terraformWriter.Literal `cty:"zone_id"`
}
type terraformAlias struct {
Name *terraformWriter.Literal `json:"name" cty:"name"`
Type *terraformWriter.Literal `json:"type" cty:"type"`
ZoneID *terraformWriter.Literal `json:"zone_id" cty:"zone_id"`
EvaluateTargetHealth *bool `json:"evaluate_target_health" cty:"evaluate_target_health"`
Name *terraformWriter.Literal `cty:"name"`
Type *terraformWriter.Literal `cty:"type"`
ZoneID *terraformWriter.Literal `cty:"zone_id"`
EvaluateTargetHealth *bool `cty:"evaluate_target_health"`
}
func (_ *DNSName) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *DNSName) error {

View File

@ -226,9 +226,9 @@ func (_ *DNSZone) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *DNSZone) error
}
type terraformRoute53ZoneAssociation struct {
ZoneID *terraformWriter.Literal `json:"zone_id" cty:"zone_id"`
VPCID *terraformWriter.Literal `json:"vpc_id" cty:"vpc_id"`
Lifecycle *terraform.Lifecycle `json:"lifecycle,omitempty" cty:"lifecycle"`
ZoneID *terraformWriter.Literal `cty:"zone_id"`
VPCID *terraformWriter.Literal `cty:"vpc_id"`
Lifecycle *terraform.Lifecycle `cty:"lifecycle"`
}
func (_ *DNSZone) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *DNSZone) error {

View File

@ -218,14 +218,14 @@ func (e *EBSVolume) getEBSVolumeTagsToDelete(currentTags map[string]string) map[
}
type terraformVolume struct {
AvailabilityZone *string `json:"availability_zone,omitempty" cty:"availability_zone"`
Size *int64 `json:"size,omitempty" cty:"size"`
Type *string `json:"type,omitempty" cty:"type"`
Iops *int64 `json:"iops,omitempty" cty:"iops"`
Throughput *int64 `json:"throughput,omitempty" cty:"throughput"`
KmsKeyId *string `json:"kms_key_id,omitempty" cty:"kms_key_id"`
Encrypted *bool `json:"encrypted,omitempty" cty:"encrypted"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
AvailabilityZone *string `cty:"availability_zone"`
Size *int64 `cty:"size"`
Type *string `cty:"type"`
Iops *int64 `cty:"iops"`
Throughput *int64 `cty:"throughput"`
KmsKeyId *string `cty:"kms_key_id"`
Encrypted *bool `cty:"encrypted"`
Tags map[string]string `cty:"tags"`
}
func (_ *EBSVolume) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *EBSVolume) error {

View File

@ -167,8 +167,8 @@ func (_ *EgressOnlyInternetGateway) RenderAWS(t *awsup.AWSAPITarget, a, e, chang
}
type terraformEgressOnlyInternetGateway struct {
VPCID *terraformWriter.Literal `json:"vpc_id" cty:"vpc_id"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
VPCID *terraformWriter.Literal `cty:"vpc_id"`
Tags map[string]string `cty:"tags"`
}
func (_ *EgressOnlyInternetGateway) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *EgressOnlyInternetGateway) error {

View File

@ -272,8 +272,8 @@ func (_ *ElasticIP) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *ElasticIP) e
}
type terraformElasticIP struct {
VPC *bool `json:"vpc" cty:"vpc"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
VPC *bool `cty:"vpc"`
Tags map[string]string `cty:"tags"`
}
func (_ *ElasticIP) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *ElasticIP) error {

View File

@ -127,9 +127,9 @@ func (eb *EventBridgeRule) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Event
}
type terraformEventBridgeRule struct {
Name *string `json:"name" cty:"name"`
EventPattern *terraformWriter.Literal `json:"event_pattern" cty:"event_pattern"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
Name *string `cty:"name"`
EventPattern *terraformWriter.Literal `cty:"event_pattern"`
Tags map[string]string `cty:"tags"`
}
func (_ *EventBridgeRule) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *EventBridgeRule) error {

View File

@ -128,8 +128,8 @@ func (eb *EventBridgeTarget) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Eve
}
type terraformEventBridgeTarget struct {
RuleName *terraformWriter.Literal `json:"rule" cty:"rule"`
TargetArn *terraformWriter.Literal `json:"arn" cty:"arn"`
RuleName *terraformWriter.Literal `cty:"rule"`
TargetArn *terraformWriter.Literal `cty:"arn"`
}
func (_ *EventBridgeTarget) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *EventBridgeTarget) error {

View File

@ -111,9 +111,9 @@ func (_ *IAMInstanceProfileRole) RenderAWS(t *awsup.AWSAPITarget, a, e, changes
}
type terraformIAMInstanceProfile struct {
Name *string `json:"name" cty:"name"`
Role *terraformWriter.Literal `json:"role" cty:"role"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
Name *string `cty:"name"`
Role *terraformWriter.Literal `cty:"role"`
Tags map[string]string `cty:"tags"`
}
func (_ *IAMInstanceProfileRole) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *IAMInstanceProfileRole) error {

View File

@ -213,12 +213,12 @@ func (p *IAMOIDCProvider) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *IAMOID
}
type terraformIAMOIDCProvider struct {
URL *string `json:"url" cty:"url"`
ClientIDList []*string `json:"client_id_list" cty:"client_id_list"`
ThumbprintList []*string `json:"thumbprint_list" cty:"thumbprint_list"`
URL *string `cty:"url"`
ClientIDList []*string `cty:"client_id_list"`
ThumbprintList []*string `cty:"thumbprint_list"`
AssumeRolePolicy *terraformWriter.Literal `json:"assume_role_policy" cty:"assume_role_policy"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
AssumeRolePolicy *terraformWriter.Literal `cty:"assume_role_policy"`
Tags map[string]string `cty:"tags"`
}
func (p *IAMOIDCProvider) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *IAMOIDCProvider) error {

View File

@ -325,10 +325,10 @@ func (_ *IAMRole) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *IAMRole) error
}
type terraformIAMRole struct {
Name *string `json:"name" cty:"name"`
AssumeRolePolicy *terraformWriter.Literal `json:"assume_role_policy" cty:"assume_role_policy"`
PermissionsBoundary *string `json:"permissions_boundary,omitempty" cty:"permissions_boundary"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
Name *string `cty:"name"`
AssumeRolePolicy *terraformWriter.Literal `cty:"assume_role_policy"`
PermissionsBoundary *string `cty:"permissions_boundary"`
Tags map[string]string `cty:"tags"`
}
func (_ *IAMRole) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *IAMRole) error {

View File

@ -305,10 +305,10 @@ func (e *IAMRolePolicy) policyDocumentString() (string, error) {
}
type terraformIAMRolePolicy struct {
Name *string `json:"name,omitempty" cty:"name"`
Role *terraformWriter.Literal `json:"role" cty:"role"`
PolicyDocument *terraformWriter.Literal `json:"policy,omitempty" cty:"policy"`
PolicyArn *string `json:"policy_arn,omitempty" cty:"policy_arn"`
Name *string `cty:"name"`
Role *terraformWriter.Literal `cty:"role"`
PolicyDocument *terraformWriter.Literal `cty:"policy"`
PolicyArn *string `cty:"policy_arn"`
}
func (_ *IAMRolePolicy) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *IAMRolePolicy) error {

View File

@ -180,8 +180,8 @@ func (_ *InternetGateway) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Intern
}
type terraformInternetGateway struct {
VPCID *terraformWriter.Literal `json:"vpc_id" cty:"vpc_id"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
VPCID *terraformWriter.Literal `cty:"vpc_id"`
Tags map[string]string `cty:"tags"`
}
func (_ *InternetGateway) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *InternetGateway) error {

View File

@ -25,144 +25,144 @@ import (
type terraformLaunchTemplateNetworkInterface struct {
// AssociatePublicIPAddress associates a public ip address with the network interface. Boolean value.
AssociatePublicIPAddress *bool `json:"associate_public_ip_address,omitempty" cty:"associate_public_ip_address"`
AssociatePublicIPAddress *bool `cty:"associate_public_ip_address"`
// DeleteOnTermination indicates whether the network interface should be destroyed on instance termination.
DeleteOnTermination *bool `json:"delete_on_termination,omitempty" cty:"delete_on_termination"`
DeleteOnTermination *bool `cty:"delete_on_termination"`
// Ipv6AddressCount is the number of IPv6 addresses to assign with the primary network interface.
Ipv6AddressCount *int64 `json:"ipv6_address_count,omitempty" cty:"ipv6_address_count"`
Ipv6AddressCount *int64 `cty:"ipv6_address_count"`
// SecurityGroups is a list of security group ids.
SecurityGroups []*terraformWriter.Literal `json:"security_groups,omitempty" cty:"security_groups"`
SecurityGroups []*terraformWriter.Literal `cty:"security_groups"`
}
type terraformLaunchTemplateMonitoring struct {
// Enabled indicates that monitoring is enabled
Enabled *bool `json:"enabled,omitempty" cty:"enabled"`
Enabled *bool `cty:"enabled"`
}
type terraformLaunchTemplatePlacement struct {
// Affinity is he affinity setting for an instance on a Dedicated Host.
Affinity *string `json:"affinity,omitempty" cty:"affinity"`
Affinity *string `cty:"affinity"`
// AvailabilityZone is the Availability Zone for the instance.
AvailabilityZone *string `json:"availability_zone,omitempty" cty:"availability_zone"`
AvailabilityZone *string `cty:"availability_zone"`
// GroupName is the name of the placement group for the instance.
GroupName *string `json:"group_name,omitempty" cty:"group_name"`
GroupName *string `cty:"group_name"`
// HostID is the ID of the Dedicated Host for the instance.
HostID *string `json:"host_id,omitempty" cty:"host_id"`
HostID *string `cty:"host_id"`
// SpreadDomain are reserved for future use.
SpreadDomain *string `json:"spread_domain,omitempty" cty:"spread_domain"`
SpreadDomain *string `cty:"spread_domain"`
// Tenancy ist he tenancy of the instance. Can be default, dedicated, or host.
Tenancy *string `json:"tenancy,omitempty" cty:"tenancy"`
Tenancy *string `cty:"tenancy"`
}
type terraformLaunchTemplateIAMProfile struct {
// Name is the name of the profile
Name *terraformWriter.Literal `json:"name,omitempty" cty:"name"`
Name *terraformWriter.Literal `cty:"name"`
}
type terraformLaunchTemplateMarketOptionsSpotOptions struct {
// BlockDurationMinutes is required duration in minutes. This value must be a multiple of 60.
BlockDurationMinutes *int64 `json:"block_duration_minutes,omitempty" cty:"block_duration_minutes"`
BlockDurationMinutes *int64 `cty:"block_duration_minutes"`
// InstanceInterruptionBehavior is the behavior when a Spot Instance is interrupted. Can be hibernate, stop, or terminate
InstanceInterruptionBehavior *string `json:"instance_interruption_behavior,omitempty" cty:"instance_interruption_behavior"`
InstanceInterruptionBehavior *string `cty:"instance_interruption_behavior"`
// MaxPrice is the maximum hourly price you're willing to pay for the Spot Instances
MaxPrice *string `json:"max_price,omitempty" cty:"max_price"`
MaxPrice *string `cty:"max_price"`
// SpotInstanceType is the Spot Instance request type. Can be one-time, or persistent
SpotInstanceType *string `json:"spot_instance_type,omitempty" cty:"spot_instance_type"`
SpotInstanceType *string `cty:"spot_instance_type"`
// ValidUntil is the end date of the request
ValidUntil *string `json:"valid_until,omitempty" cty:"valid_until"`
ValidUntil *string `cty:"valid_until"`
}
type terraformLaunchTemplateMarketOptions struct {
// MarketType is the option type
MarketType *string `json:"market_type,omitempty" cty:"market_type"`
MarketType *string `cty:"market_type"`
// SpotOptions are the set of options
SpotOptions []*terraformLaunchTemplateMarketOptionsSpotOptions `json:"spot_options,omitempty" cty:"spot_options"`
SpotOptions []*terraformLaunchTemplateMarketOptionsSpotOptions `cty:"spot_options"`
}
type terraformLaunchTemplateBlockDeviceEBS struct {
// VolumeType is the ebs type to use
VolumeType *string `json:"volume_type,omitempty" cty:"volume_type"`
VolumeType *string `cty:"volume_type"`
// VolumeSize is the volume size
VolumeSize *int64 `json:"volume_size,omitempty" cty:"volume_size"`
VolumeSize *int64 `cty:"volume_size"`
// IOPS is the provisioned IOPS
IOPS *int64 `json:"iops,omitempty" cty:"iops"`
IOPS *int64 `cty:"iops"`
// Throughput is the gp3 volume throughput
Throughput *int64 `json:"throughput,omitempty" cty:"throughput"`
Throughput *int64 `cty:"throughput"`
// DeleteOnTermination indicates the volume should die with the instance
DeleteOnTermination *bool `json:"delete_on_termination,omitempty" cty:"delete_on_termination"`
DeleteOnTermination *bool `cty:"delete_on_termination"`
// Encrypted indicates the device should be encrypted
Encrypted *bool `json:"encrypted,omitempty" cty:"encrypted"`
Encrypted *bool `cty:"encrypted"`
// KmsKeyID is the encryption key identifier for the volume
KmsKeyID *string `json:"kms_key_id,omitempty" cty:"kms_key_id"`
KmsKeyID *string `cty:"kms_key_id"`
}
type terraformLaunchTemplateBlockDevice struct {
// DeviceName is the name of the device
DeviceName *string `json:"device_name,omitempty" cty:"device_name"`
DeviceName *string `cty:"device_name"`
// VirtualName is used for the ephemeral devices
VirtualName *string `json:"virtual_name,omitempty" cty:"virtual_name"`
VirtualName *string `cty:"virtual_name"`
// EBS defines the ebs spec
EBS []*terraformLaunchTemplateBlockDeviceEBS `json:"ebs,omitempty" cty:"ebs"`
EBS []*terraformLaunchTemplateBlockDeviceEBS `cty:"ebs"`
}
type terraformLaunchTemplateCreditSpecification struct {
CPUCredits *string `json:"cpu_credits,omitempty" cty:"cpu_credits"`
CPUCredits *string `cty:"cpu_credits"`
}
type terraformLaunchTemplateTagSpecification struct {
// ResourceType is the type of resource to tag.
ResourceType *string `json:"resource_type,omitempty" cty:"resource_type"`
ResourceType *string `cty:"resource_type"`
// Tags are the tags to apply to the resource.
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
Tags map[string]string `cty:"tags"`
}
type terraformLaunchTemplateInstanceMetadata struct {
// HTTPEndpoint enables or disables the HTTP metadata endpoint on instances.
HTTPEndpoint *string `json:"http_endpoint,omitempty" cty:"http_endpoint"`
HTTPEndpoint *string `cty:"http_endpoint"`
// HTTPPutResponseHopLimit is the desired HTTP PUT response hop limit for instance metadata requests.
HTTPPutResponseHopLimit *int64 `json:"http_put_response_hop_limit,omitempty" cty:"http_put_response_hop_limit"`
HTTPPutResponseHopLimit *int64 `cty:"http_put_response_hop_limit"`
// HTTPTokens is the state of token usage for your instance metadata requests.
HTTPTokens *string `json:"http_tokens,omitempty" cty:"http_tokens"`
HTTPTokens *string `cty:"http_tokens"`
// HTTPProtocolIPv6 enables the IPv6 instance metadata endpoint
HTTPProtocolIPv6 *string `json:"http_protocol_ipv6,omitempty" cty:"http_protocol_ipv6"`
HTTPProtocolIPv6 *string `cty:"http_protocol_ipv6"`
}
type terraformLaunchTemplate struct {
// Name is the name of the launch template
Name *string `json:"name,omitempty" cty:"name"`
Name *string `cty:"name"`
// Lifecycle is the terraform lifecycle
Lifecycle *terraform.Lifecycle `json:"lifecycle,omitempty" cty:"lifecycle"`
Lifecycle *terraform.Lifecycle `cty:"lifecycle"`
// BlockDeviceMappings is the device mappings
BlockDeviceMappings []*terraformLaunchTemplateBlockDevice `json:"block_device_mappings,omitempty" cty:"block_device_mappings"`
BlockDeviceMappings []*terraformLaunchTemplateBlockDevice `cty:"block_device_mappings"`
// CreditSpecification is the credit option for CPU Usage on some instance types
CreditSpecification *terraformLaunchTemplateCreditSpecification `json:"credit_specification,omitempty" cty:"credit_specification"`
CreditSpecification *terraformLaunchTemplateCreditSpecification `cty:"credit_specification"`
// EBSOptimized indicates if the root device is ebs optimized
EBSOptimized *bool `json:"ebs_optimized,omitempty" cty:"ebs_optimized"`
EBSOptimized *bool `cty:"ebs_optimized"`
// IAMInstanceProfile is the IAM profile to assign to the nodes
IAMInstanceProfile []*terraformLaunchTemplateIAMProfile `json:"iam_instance_profile,omitempty" cty:"iam_instance_profile"`
IAMInstanceProfile []*terraformLaunchTemplateIAMProfile `cty:"iam_instance_profile"`
// ImageID is the ami to use for the instances
ImageID *string `json:"image_id,omitempty" cty:"image_id"`
ImageID *string `cty:"image_id"`
// InstanceType is the type of instance
InstanceType *string `json:"instance_type,omitempty" cty:"instance_type"`
InstanceType *string `cty:"instance_type"`
// KeyName is the ssh key to use
KeyName *terraformWriter.Literal `json:"key_name,omitempty" cty:"key_name"`
KeyName *terraformWriter.Literal `cty:"key_name"`
// MarketOptions are the spot pricing options
MarketOptions []*terraformLaunchTemplateMarketOptions `json:"instance_market_options,omitempty" cty:"instance_market_options"`
MarketOptions []*terraformLaunchTemplateMarketOptions `cty:"instance_market_options"`
// MetadataOptions are the instance metadata options.
MetadataOptions *terraformLaunchTemplateInstanceMetadata `json:"metadata_options,omitempty" cty:"metadata_options"`
MetadataOptions *terraformLaunchTemplateInstanceMetadata `cty:"metadata_options"`
// Monitoring are the instance monitoring options
Monitoring []*terraformLaunchTemplateMonitoring `json:"monitoring,omitempty" cty:"monitoring"`
Monitoring []*terraformLaunchTemplateMonitoring `cty:"monitoring"`
// NetworkInterfaces are the networking options
NetworkInterfaces []*terraformLaunchTemplateNetworkInterface `json:"network_interfaces,omitempty" cty:"network_interfaces"`
NetworkInterfaces []*terraformLaunchTemplateNetworkInterface `cty:"network_interfaces"`
// Placement are the tenancy options
Placement []*terraformLaunchTemplatePlacement `json:"placement,omitempty" cty:"placement"`
Placement []*terraformLaunchTemplatePlacement `cty:"placement"`
// Tags is a map of tags applied to the launch template itself
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
Tags map[string]string `cty:"tags"`
// TagSpecifications are the tags to apply to a resource when it is created.
TagSpecifications []*terraformLaunchTemplateTagSpecification `json:"tag_specifications,omitempty" cty:"tag_specifications"`
TagSpecifications []*terraformLaunchTemplateTagSpecification `cty:"tag_specifications"`
// UserData is the user data for the instances
UserData *terraformWriter.Literal `json:"user_data,omitempty" cty:"user_data"`
UserData *terraformWriter.Literal `cty:"user_data"`
}
// TerraformLink returns the terraform reference

View File

@ -361,9 +361,9 @@ func (_ *NatGateway) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *NatGateway)
}
type terraformNATGateway struct {
AllocationID *terraformWriter.Literal `json:"allocation_id,omitempty" cty:"allocation_id"`
SubnetID *terraformWriter.Literal `json:"subnet_id,omitempty" cty:"subnet_id"`
Tag map[string]string `json:"tags,omitempty" cty:"tags"`
AllocationID *terraformWriter.Literal `cty:"allocation_id"`
SubnetID *terraformWriter.Literal `cty:"subnet_id"`
Tag map[string]string `cty:"tags"`
}
func (_ *NatGateway) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *NatGateway) error {

View File

@ -694,34 +694,34 @@ func (_ *NetworkLoadBalancer) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Ne
}
type terraformNetworkLoadBalancer struct {
Name string `json:"name" cty:"name"`
Internal bool `json:"internal" cty:"internal"`
Type string `json:"load_balancer_type" cty:"load_balancer_type"`
SubnetMappings []terraformNetworkLoadBalancerSubnetMapping `json:"subnet_mapping" cty:"subnet_mapping"`
CrossZoneLoadBalancing bool `json:"enable_cross_zone_load_balancing" cty:"enable_cross_zone_load_balancing"`
AccessLog *terraformNetworkLoadBalancerAccessLog `json:"access_logs,omitempty" cty:"access_logs"`
Name string `cty:"name"`
Internal bool `cty:"internal"`
Type string `cty:"load_balancer_type"`
SubnetMappings []terraformNetworkLoadBalancerSubnetMapping `cty:"subnet_mapping"`
CrossZoneLoadBalancing bool `cty:"enable_cross_zone_load_balancing"`
AccessLog *terraformNetworkLoadBalancerAccessLog `cty:"access_logs"`
Tags map[string]string `json:"tags" cty:"tags"`
Tags map[string]string `cty:"tags"`
}
type terraformNetworkLoadBalancerSubnetMapping struct {
Subnet *terraformWriter.Literal `json:"subnet_id" cty:"subnet_id"`
AllocationID *string `json:"allocation_id,omitempty" cty:"allocation_id"`
PrivateIPv4Address *string `json:"private_ipv4_address,omitempty" cty:"private_ipv4_address"`
Subnet *terraformWriter.Literal `cty:"subnet_id"`
AllocationID *string `cty:"allocation_id"`
PrivateIPv4Address *string `cty:"private_ipv4_address"`
}
type terraformNetworkLoadBalancerListener struct {
LoadBalancer *terraformWriter.Literal `json:"load_balancer_arn" cty:"load_balancer_arn"`
Port int64 `json:"port" cty:"port"`
Protocol string `json:"protocol" cty:"protocol"`
CertificateARN *string `json:"certificate_arn,omitempty" cty:"certificate_arn"`
SSLPolicy *string `json:"ssl_policy,omitempty" cty:"ssl_policy"`
DefaultAction []terraformNetworkLoadBalancerListenerAction `json:"default_action" cty:"default_action"`
LoadBalancer *terraformWriter.Literal `cty:"load_balancer_arn"`
Port int64 `cty:"port"`
Protocol string `cty:"protocol"`
CertificateARN *string `cty:"certificate_arn"`
SSLPolicy *string `cty:"ssl_policy"`
DefaultAction []terraformNetworkLoadBalancerListenerAction `cty:"default_action"`
}
type terraformNetworkLoadBalancerListenerAction struct {
Type string `json:"type" cty:"type"`
TargetGroupARN *terraformWriter.Literal `json:"target_group_arn,omitempty" cty:"target_group_arn"`
Type string `cty:"type"`
TargetGroupARN *terraformWriter.Literal `cty:"target_group_arn"`
}
func (_ *NetworkLoadBalancer) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *NetworkLoadBalancer) error {

View File

@ -38,9 +38,9 @@ func (_ *NetworkLoadBalancerAccessLog) GetDependencies(tasks map[string]fi.Task)
}
type terraformNetworkLoadBalancerAccessLog struct {
Enabled *bool `json:"enabled,omitempty" cty:"enabled"`
S3BucketName *string `json:"bucket,omitempty" cty:"bucket"`
S3BucketPrefix *string `json:"bucket_prefix,omitempty" cty:"prefix"`
Enabled *bool `cty:"enabled"`
S3BucketName *string `cty:"bucket"`
S3BucketPrefix *string `cty:"prefix"`
}
func findNetworkLoadBalancerAttributes(cloud awsup.AWSCloud, LoadBalancerArn string) ([]*elbv2.LoadBalancerAttribute, error) {

View File

@ -271,14 +271,14 @@ func checkNotNil(s *string) *string {
}
type terraformRoute struct {
RouteTableID *terraformWriter.Literal `json:"route_table_id" cty:"route_table_id"`
CIDR *string `json:"destination_cidr_block,omitempty" cty:"destination_cidr_block"`
IPv6CIDR *string `json:"destination_ipv6_cidr_block,omitempty" cty:"destination_ipv6_cidr_block"`
EgressOnlyInternetGatewayID *terraformWriter.Literal `json:"egress_onlygateway_id,omitempty" cty:"egress_only_gateway_id"`
InternetGatewayID *terraformWriter.Literal `json:"gateway_id,omitempty" cty:"gateway_id"`
NATGatewayID *terraformWriter.Literal `json:"nat_gateway_id,omitempty" cty:"nat_gateway_id"`
TransitGatewayID *string `json:"transit_gateway_id,omitempty" cty:"transit_gateway_id"`
InstanceID *terraformWriter.Literal `json:"instance_id,omitempty" cty:"instance_id"`
RouteTableID *terraformWriter.Literal `cty:"route_table_id"`
CIDR *string `cty:"destination_cidr_block"`
IPv6CIDR *string `cty:"destination_ipv6_cidr_block"`
EgressOnlyInternetGatewayID *terraformWriter.Literal `cty:"egress_only_gateway_id"`
InternetGatewayID *terraformWriter.Literal `cty:"gateway_id"`
NATGatewayID *terraformWriter.Literal `cty:"nat_gateway_id"`
TransitGatewayID *string `cty:"transit_gateway_id"`
InstanceID *terraformWriter.Literal `cty:"instance_id"`
}
func (_ *Route) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Route) error {

View File

@ -192,8 +192,8 @@ func (_ *RouteTable) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *RouteTable)
}
type terraformRouteTable struct {
VPCID *terraformWriter.Literal `json:"vpc_id" cty:"vpc_id"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
VPCID *terraformWriter.Literal `cty:"vpc_id"`
Tags map[string]string `cty:"tags"`
}
func (_ *RouteTable) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *RouteTable) error {

View File

@ -188,8 +188,8 @@ func (_ *RouteTableAssociation) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *
}
type terraformRouteTableAssociation struct {
SubnetID *terraformWriter.Literal `json:"subnet_id" cty:"subnet_id"`
RouteTableID *terraformWriter.Literal `json:"route_table_id" cty:"route_table_id"`
SubnetID *terraformWriter.Literal `cty:"subnet_id"`
RouteTableID *terraformWriter.Literal `cty:"route_table_id"`
}
func (_ *RouteTableAssociation) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *RouteTableAssociation) error {

View File

@ -186,10 +186,10 @@ func (_ *SecurityGroup) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Security
}
type terraformSecurityGroup struct {
Name *string `json:"name" cty:"name"`
VPCID *terraformWriter.Literal `json:"vpc_id" cty:"vpc_id"`
Description *string `json:"description" cty:"description"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
Name *string `cty:"name"`
VPCID *terraformWriter.Literal `cty:"vpc_id"`
Description *string `cty:"description"`
Tags map[string]string `cty:"tags"`
}
func (_ *SecurityGroup) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *SecurityGroup) error {

View File

@ -309,17 +309,17 @@ func (_ *SecurityGroupRule) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Secu
}
type terraformSecurityGroupIngress struct {
Type *string `json:"type" cty:"type"`
Type *string `cty:"type"`
SecurityGroup *terraformWriter.Literal `json:"security_group_id" cty:"security_group_id"`
SourceGroup *terraformWriter.Literal `json:"source_security_group_id,omitempty" cty:"source_security_group_id"`
SecurityGroup *terraformWriter.Literal `cty:"security_group_id"`
SourceGroup *terraformWriter.Literal `cty:"source_security_group_id"`
FromPort *int64 `json:"from_port,omitempty" cty:"from_port"`
ToPort *int64 `json:"to_port,omitempty" cty:"to_port"`
FromPort *int64 `cty:"from_port"`
ToPort *int64 `cty:"to_port"`
Protocol *string `json:"protocol,omitempty" cty:"protocol"`
CIDRBlocks []string `json:"cidr_blocks,omitempty" cty:"cidr_blocks"`
IPv6CIDRBlocks []string `json:"ipv6_cidr_blocks,omitempty" cty:"ipv6_cidr_blocks"`
Protocol *string `cty:"protocol"`
CIDRBlocks []string `cty:"cidr_blocks"`
IPv6CIDRBlocks []string `cty:"ipv6_cidr_blocks"`
}
func (_ *SecurityGroupRule) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *SecurityGroupRule) error {

View File

@ -188,10 +188,10 @@ func (q *SQS) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *SQS) error {
}
type terraformSQSQueue struct {
Name *string `json:"name" cty:"name"`
MessageRetentionSeconds int `json:"message_retention_seconds" cty:"message_retention_seconds"`
Policy *terraformWriter.Literal `json:"policy" cty:"policy"`
Tags map[string]string `json:"tags" cty:"tags"`
Name *string `cty:"name"`
MessageRetentionSeconds int `cty:"message_retention_seconds"`
Policy *terraformWriter.Literal `cty:"policy"`
Tags map[string]string `cty:"tags"`
}
func (_ *SQS) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *SQS) error {

View File

@ -183,9 +183,9 @@ func (_ *SSHKey) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *SSHKey) error {
}
type terraformSSHKey struct {
Name *string `json:"key_name" cty:"key_name"`
PublicKey *terraformWriter.Literal `json:"public_key" cty:"public_key"`
Tags map[string]string `json:"tags" cty:"tags"`
Name *string `cty:"key_name"`
PublicKey *terraformWriter.Literal `cty:"public_key"`
Tags map[string]string `cty:"tags"`
}
func (_ *SSHKey) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *SSHKey) error {

View File

@ -355,11 +355,11 @@ func subnetSlicesEqualIgnoreOrder(l, r []*Subnet) bool {
}
type terraformSubnet struct {
VPCID *terraformWriter.Literal `json:"vpc_id" cty:"vpc_id"`
CIDR *string `json:"cidr_block" cty:"cidr_block"`
IPv6CIDR *string `json:"ipv6_cidr_block" cty:"ipv6_cidr_block"`
AvailabilityZone *string `json:"availability_zone" cty:"availability_zone"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
VPCID *terraformWriter.Literal `cty:"vpc_id"`
CIDR *string `cty:"cidr_block"`
IPv6CIDR *string `cty:"ipv6_cidr_block"`
AvailabilityZone *string `cty:"availability_zone"`
Tags map[string]string `cty:"tags"`
}
func (_ *Subnet) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Subnet) error {

View File

@ -206,18 +206,18 @@ func (a OrderTargetGroupsByName) Less(i, j int) bool {
}
type terraformTargetGroup struct {
Name string `json:"name" cty:"name"`
Port int64 `json:"port" cty:"port"`
Protocol string `json:"protocol" cty:"protocol"`
VPCID terraformWriter.Literal `json:"vpc_id" cty:"vpc_id"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
HealthCheck terraformTargetGroupHealthCheck `json:"health_check" cty:"health_check"`
Name string `cty:"name"`
Port int64 `cty:"port"`
Protocol string `cty:"protocol"`
VPCID terraformWriter.Literal `cty:"vpc_id"`
Tags map[string]string `cty:"tags"`
HealthCheck terraformTargetGroupHealthCheck `cty:"health_check"`
}
type terraformTargetGroupHealthCheck struct {
HealthyThreshold int64 `json:"healthy_threshold" cty:"healthy_threshold"`
UnhealthyThreshold int64 `json:"unhealthy_threshold" cty:"unhealthy_threshold"`
Protocol string `json:"protocol" cty:"protocol"`
HealthyThreshold int64 `cty:"healthy_threshold"`
UnhealthyThreshold int64 `cty:"unhealthy_threshold"`
Protocol string `cty:"protocol"`
}
func (_ *TargetGroup) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *TargetGroup) error {

View File

@ -281,11 +281,11 @@ func (e *VPC) FindDeletions(c *fi.Context) ([]fi.Deletion, error) {
}
type terraformVPC struct {
CIDR *string `json:"cidr_block,omitempty" cty:"cidr_block"`
EnableDNSHostnames *bool `json:"enable_dns_hostnames,omitempty" cty:"enable_dns_hostnames"`
EnableDNSSupport *bool `json:"enable_dns_support,omitempty" cty:"enable_dns_support"`
AmazonIPv6 *bool `json:"assign_generated_ipv6_cidr_block,omitempty" cty:"assign_generated_ipv6_cidr_block"`
Tags map[string]string `json:"tags,omitempty" cty:"tags"`
CIDR *string `cty:"cidr_block"`
EnableDNSHostnames *bool `cty:"enable_dns_hostnames"`
EnableDNSSupport *bool `cty:"enable_dns_support"`
AmazonIPv6 *bool `cty:"assign_generated_ipv6_cidr_block"`
Tags map[string]string `cty:"tags"`
}
func (_ *VPC) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *VPC) error {

View File

@ -103,8 +103,8 @@ func (_ *VPCDHCPOptionsAssociation) RenderAWS(t *awsup.AWSAPITarget, a, e, chang
}
type terraformVPCDHCPOptionsAssociation struct {
VPCID *terraformWriter.Literal `json:"vpc_id" cty:"vpc_id"`
DHCPOptionsID *terraformWriter.Literal `json:"dhcp_options_id" cty:"dhcp_options_id"`
VPCID *terraformWriter.Literal `cty:"vpc_id"`
DHCPOptionsID *terraformWriter.Literal `cty:"dhcp_options_id"`
}
func (_ *VPCDHCPOptionsAssociation) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *VPCDHCPOptionsAssociation) error {

View File

@ -140,8 +140,8 @@ func (_ *VPCCIDRBlock) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *VPCCIDRBl
}
type terraformVPCCIDRBlock struct {
VPCID *terraformWriter.Literal `json:"vpc_id" cty:"vpc_id"`
CIDRBlock *string `json:"cidr_block" cty:"cidr_block"`
VPCID *terraformWriter.Literal `cty:"vpc_id"`
CIDRBlock *string `cty:"cidr_block"`
}
func (_ *VPCCIDRBlock) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *VPCCIDRBlock) error {

View File

@ -132,9 +132,9 @@ func (_ *Volume) RenderDO(t *do.DOAPITarget, a, e, changes *Volume) error {
// terraformVolume represents the digitalocean_volume resource in terraform
// https://www.terraform.io/docs/providers/do/r/volume.html
type terraformVolume struct {
Name *string `json:"name" cty:"name"`
SizeGB *int64 `json:"size" cty:"size"`
Region *string `json:"region" cty:"region"`
Name *string `cty:"name"`
SizeGB *int64 `cty:"size"`
Region *string `cty:"region"`
}
func (_ *Volume) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Volume) error {

View File

@ -154,7 +154,7 @@ func (_ *Address) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Address) error {
}
type terraformAddress struct {
Name *string `json:"name,omitempty" cty:"name"`
Name *string `cty:"name"`
}
func (_ *Address) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Address) error {

View File

@ -163,11 +163,11 @@ func (_ *Disk) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Disk) error {
}
type terraformDisk struct {
Name *string `json:"name" cty:"name"`
VolumeType *string `json:"type" cty:"type"`
SizeGB *int64 `json:"size" cty:"size"`
Zone *string `json:"zone" cty:"zone"`
Labels map[string]string `json:"labels,omitempty" cty:"labels"`
Name *string `cty:"name"`
VolumeType *string `cty:"type"`
SizeGB *int64 `cty:"size"`
Zone *string `cty:"zone"`
Labels map[string]string `cty:"labels"`
}
func (_ *Disk) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Disk) error {

View File

@ -213,22 +213,22 @@ func (_ *FirewallRule) RenderGCE(t *gce.GCEAPITarget, a, e, changes *FirewallRul
}
type terraformAllow struct {
Protocol string `json:"protocol,omitempty" cty:"protocol"`
Ports []string `json:"ports,omitempty" cty:"ports"`
Protocol string `cty:"protocol"`
Ports []string `cty:"ports"`
}
type terraformFirewall struct {
Name string `json:"name" cty:"name"`
Network *terraformWriter.Literal `json:"network" cty:"network"`
Name string `cty:"name"`
Network *terraformWriter.Literal `cty:"network"`
Allowed []*terraformAllow `json:"allow,omitempty" cty:"allow"`
Allowed []*terraformAllow `cty:"allow"`
SourceTags []string `json:"source_tags,omitempty" cty:"source_tags"`
SourceTags []string `cty:"source_tags"`
SourceRanges []string `json:"source_ranges,omitempty" cty:"source_ranges"`
TargetTags []string `json:"target_tags,omitempty" cty:"target_tags"`
SourceRanges []string `cty:"source_ranges"`
TargetTags []string `cty:"target_tags"`
Disabled bool `json:"disabled,omitempty" cty:"disabled"`
Disabled bool `cty:"disabled"`
}
func (_ *FirewallRule) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *FirewallRule) error {

View File

@ -139,11 +139,11 @@ func (_ *ForwardingRule) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Forwardin
}
type terraformForwardingRule struct {
Name string `json:"name" cty:"name"`
PortRange string `json:"port_range,omitempty" cty:"port_range"`
Target *terraformWriter.Literal `json:"target,omitempty" cty:"target"`
IPAddress *terraformWriter.Literal `json:"ip_address,omitempty" cty:"ip_address"`
IPProtocol string `json:"ip_protocol,omitempty" cty:"ip_protocol"`
Name string `cty:"name"`
PortRange string `cty:"port_range"`
Target *terraformWriter.Literal `cty:"target"`
IPAddress *terraformWriter.Literal `cty:"ip_address"`
IPProtocol string `cty:"ip_protocol"`
}
func (_ *ForwardingRule) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *ForwardingRule) error {

View File

@ -394,29 +394,29 @@ func ShortenImageURL(defaultProject string, imageURL string) (string, error) {
}
type terraformInstance struct {
Name string `json:"name" cty:"name"`
CanIPForward bool `json:"can_ip_forward" cty:"can_ip_forward"`
MachineType string `json:"machine_type,omitempty" cty:"machine_type"`
ServiceAccounts []*terraformTemplateServiceAccount `json:"service_account,omitempty" cty:"service_account"`
Scheduling *terraformScheduling `json:"scheduling,omitempty" cty:"scheduling"`
Disks []*terraformInstanceAttachedDisk `json:"disk,omitempty" cty:"disk"`
NetworkInterfaces []*terraformNetworkInterface `json:"network_interface,omitempty" cty:"network_interface"`
Metadata map[string]*terraformWriter.Literal `json:"metadata,omitempty" cty:"metadata"`
MetadataStartupScript *terraformWriter.Literal `json:"metadata_startup_script,omitempty" cty:"metadata_startup_script"`
Tags []string `json:"tags,omitempty" cty:"tags"`
Zone string `json:"zone,omitempty" cty:"zone"`
Name string `cty:"name"`
CanIPForward bool `cty:"can_ip_forward"`
MachineType string `cty:"machine_type"`
ServiceAccounts []*terraformTemplateServiceAccount `cty:"service_account"`
Scheduling *terraformScheduling `cty:"scheduling"`
Disks []*terraformInstanceAttachedDisk `cty:"disk"`
NetworkInterfaces []*terraformNetworkInterface `cty:"network_interface"`
Metadata map[string]*terraformWriter.Literal `cty:"metadata"`
MetadataStartupScript *terraformWriter.Literal `cty:"metadata_startup_script"`
Tags []string `cty:"tags"`
Zone string `cty:"zone"`
}
type terraformInstanceAttachedDisk struct {
AutoDelete bool `json:"auto_delete,omitempty" cty:"auto_delete"`
DeviceName string `json:"device_name,omitempty" cty:"device_name"`
AutoDelete bool `cty:"auto_delete"`
DeviceName string `cty:"device_name"`
// 'pd-standard', 'pd-ssd', 'local-ssd' etc
Type string `json:"type,omitempty" cty:"type"`
Disk string `json:"disk,omitempty" cty:"disk"`
Image string `json:"image,omitempty" cty:"image"`
Scratch bool `json:"scratch,omitempty" cty:"scratch"`
Size int64 `json:"size,omitempty" cty:"size"`
Type string `cty:"type"`
Disk string `cty:"disk"`
Image string `cty:"image"`
Scratch bool `cty:"scratch"`
Size int64 `cty:"size"`
}
func (_ *Instance) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Instance) error {

View File

@ -172,16 +172,16 @@ func (_ *InstanceGroupManager) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Ins
}
type terraformInstanceGroupManager struct {
Name *string `json:"name" cty:"name"`
Zone *string `json:"zone" cty:"zone"`
BaseInstanceName *string `json:"base_instance_name" cty:"base_instance_name"`
Version *terraformVersion `json:"version" cty:"version"`
TargetSize *int64 `json:"target_size" cty:"target_size"`
TargetPools []*terraformWriter.Literal `json:"target_pools,omitempty" cty:"target_pools"`
Name *string `cty:"name"`
Zone *string `cty:"zone"`
BaseInstanceName *string `cty:"base_instance_name"`
Version *terraformVersion `cty:"version"`
TargetSize *int64 `cty:"target_size"`
TargetPools []*terraformWriter.Literal `cty:"target_pools"`
}
type terraformVersion struct {
InstanceTemplate *terraformWriter.Literal `json:"instance_template" cty:"instance_template"`
InstanceTemplate *terraformWriter.Literal `cty:"instance_template"`
}
func (_ *InstanceGroupManager) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *InstanceGroupManager) error {

View File

@ -442,54 +442,54 @@ func (_ *InstanceTemplate) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Instanc
}
type terraformInstanceTemplate struct {
NamePrefix string `json:"name_prefix" cty:"name_prefix"`
CanIPForward bool `json:"can_ip_forward" cty:"can_ip_forward"`
MachineType string `json:"machine_type,omitempty" cty:"machine_type"`
ServiceAccounts []*terraformTemplateServiceAccount `json:"service_account,omitempty" cty:"service_account"`
Scheduling *terraformScheduling `json:"scheduling,omitempty" cty:"scheduling"`
Disks []*terraformInstanceTemplateAttachedDisk `json:"disk,omitempty" cty:"disk"`
Labels map[string]string `json:"labels,omitempty" cty:"labels"`
NetworkInterfaces []*terraformNetworkInterface `json:"network_interface,omitempty" cty:"network_interface"`
Metadata map[string]*terraformWriter.Literal `json:"metadata,omitempty" cty:"metadata"`
MetadataStartupScript *terraformWriter.Literal `json:"metadata_startup_script,omitempty" cty:"metadata_startup_script"`
Tags []string `json:"tags,omitempty" cty:"tags"`
NamePrefix string `cty:"name_prefix"`
CanIPForward bool `cty:"can_ip_forward"`
MachineType string `cty:"machine_type"`
ServiceAccounts []*terraformTemplateServiceAccount `cty:"service_account"`
Scheduling *terraformScheduling `cty:"scheduling"`
Disks []*terraformInstanceTemplateAttachedDisk `cty:"disk"`
Labels map[string]string `cty:"labels"`
NetworkInterfaces []*terraformNetworkInterface `cty:"network_interface"`
Metadata map[string]*terraformWriter.Literal `cty:"metadata"`
MetadataStartupScript *terraformWriter.Literal `cty:"metadata_startup_script"`
Tags []string `cty:"tags"`
}
type terraformTemplateServiceAccount struct {
Email *terraformWriter.Literal `json:"email" cty:"email"`
Scopes []string `json:"scopes" cty:"scopes"`
Email *terraformWriter.Literal `cty:"email"`
Scopes []string `cty:"scopes"`
}
type terraformScheduling struct {
AutomaticRestart bool `json:"automatic_restart" cty:"automatic_restart"`
OnHostMaintenance string `json:"on_host_maintenance,omitempty" cty:"on_host_maintenance"`
Preemptible bool `json:"preemptible" cty:"preemptible"`
AutomaticRestart bool `cty:"automatic_restart"`
OnHostMaintenance string `cty:"on_host_maintenance"`
Preemptible bool `cty:"preemptible"`
}
type terraformInstanceTemplateAttachedDisk struct {
AutoDelete bool `json:"auto_delete,omitempty" cty:"auto_delete"`
DeviceName string `json:"device_name,omitempty" cty:"device_name"`
AutoDelete bool `cty:"auto_delete"`
DeviceName string `cty:"device_name"`
// scratch vs persistent
Type string `json:"type,omitempty" cty:"type"`
Boot bool `json:"boot,omitempty" cty:"boot"`
DiskName string `json:"disk_name,omitempty" cty:"disk_name"`
SourceImage string `json:"source_image,omitempty" cty:"source_image"`
Source string `json:"source,omitempty" cty:"source"`
Interface string `json:"interface,omitempty" cty:"interface"`
Mode string `json:"mode,omitempty" cty:"mode"`
DiskType string `json:"disk_type,omitempty" cty:"disk_type"`
DiskSizeGB int64 `json:"disk_size_gb,omitempty" cty:"disk_size_gb"`
Type string `cty:"type"`
Boot bool `cty:"boot"`
DiskName string `cty:"disk_name"`
SourceImage string `cty:"source_image"`
Source string `cty:"source"`
Interface string `cty:"interface"`
Mode string `cty:"mode"`
DiskType string `cty:"disk_type"`
DiskSizeGB int64 `cty:"disk_size_gb"`
}
type terraformNetworkInterface struct {
Network *terraformWriter.Literal `json:"network,omitempty" cty:"network"`
Subnetwork *terraformWriter.Literal `json:"subnetwork,omitempty" cty:"subnetwork"`
AccessConfig []*terraformAccessConfig `json:"access_config" cty:"access_config"`
Network *terraformWriter.Literal `cty:"network"`
Subnetwork *terraformWriter.Literal `cty:"subnetwork"`
AccessConfig []*terraformAccessConfig `cty:"access_config"`
}
type terraformAccessConfig struct {
NatIP *terraformWriter.Literal `json:"nat_ip,omitempty" cty:"nat_ip"`
NatIP *terraformWriter.Literal `cty:"nat_ip"`
}
func addNetworks(network *Network, subnet *Subnet, networkInterfaces []*compute.NetworkInterface) []*terraformNetworkInterface {

View File

@ -187,9 +187,9 @@ func (_ *Network) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Network) error {
}
type terraformNetwork struct {
Name *string `json:"name" cty:"name"`
IPv4Range *string `json:"ipv4_range,omitempty" cty:"ipv4_range"`
AutoCreateSubnetworks *bool `json:"auto_create_subnetworks,omitempty" cty:"auto_create_subnetworks"`
Name *string `cty:"name"`
IPv4Range *string `cty:"ipv4_range"`
AutoCreateSubnetworks *bool `cty:"auto_create_subnetworks"`
}
func (_ *Network) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Network) error {

View File

@ -127,9 +127,9 @@ func (_ *ProjectIAMBinding) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Projec
// terraformProjectIAMBinding is the model for a terraform google_project_iam_binding rule
type terraformProjectIAMBinding struct {
Project string `json:"project,omitempty" cty:"project"`
Role string `json:"role,omitempty" cty:"role"`
Members []string `json:"members,omitempty" cty:"members"`
Project string `cty:"project"`
Role string `cty:"role"`
Members []string `cty:"members"`
}
func (_ *ProjectIAMBinding) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *ProjectIAMBinding) error {

View File

@ -186,23 +186,23 @@ func (*Router) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Router) error {
}
type terraformRouterNat struct {
Name *string `json:"name,omitempty" cty:"name"`
Region *string `json:"region,omitempty" cty:"region"`
Router *terraformWriter.Literal `json:"router,omitempty" cty:"router"`
NATIPAllocateOption *string `json:"nat_ip_allocate_option,omitempty" cty:"nat_ip_allocate_option"`
SourceSubnetworkIPRangesToNat *string `json:"source_subnetwork_ip_ranges_to_nat,omitempty" cty:"source_subnetwork_ip_ranges_to_nat"`
Subnetworks []*terraformRouterNatSubnetwork `json:"subnetwork,omitempty" cty:"subnetwork"`
Name *string `cty:"name"`
Region *string `cty:"region"`
Router *terraformWriter.Literal `cty:"router"`
NATIPAllocateOption *string `cty:"nat_ip_allocate_option"`
SourceSubnetworkIPRangesToNat *string `cty:"source_subnetwork_ip_ranges_to_nat"`
Subnetworks []*terraformRouterNatSubnetwork `cty:"subnetwork"`
}
type terraformRouterNatSubnetwork struct {
Name *terraformWriter.Literal `json:"name,omitempty" cty:"name"`
SourceIPRangesToNat []string `json:"source_ip_ranges_to_nat,omitempty" cty:"source_ip_ranges_to_nat"`
Name *terraformWriter.Literal `cty:"name"`
SourceIPRangesToNat []string `cty:"source_ip_ranges_to_nat"`
}
type terraformRouter struct {
Name *string `json:"name,omitempty" cty:"name"`
Network *terraformWriter.Literal `json:"network,omitempty" cty:"network"`
Region *string `json:"region,omitempty" cty:"region"`
Name *string `cty:"name"`
Network *terraformWriter.Literal `cty:"network"`
Region *string `cty:"region"`
}
// RenderTerraform renders the Terraform config.

View File

@ -182,10 +182,10 @@ func (_ *ServiceAccount) RenderGCE(t *gce.GCEAPITarget, a, e, changes *ServiceAc
}
type terraformServiceAccount struct {
AccountID *string `json:"account_id" cty:"account_id"`
ProjectID *string `json:"project" cty:"project"`
Description *string `json:"description" cty:"description"`
DisplayName *string `json:"display_name" cty:"display_name"`
AccountID *string `cty:"account_id"`
ProjectID *string `cty:"project"`
Description *string `cty:"description"`
DisplayName *string `cty:"display_name"`
}
func (_ *ServiceAccount) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *ServiceAccount) error {

View File

@ -117,8 +117,8 @@ func (_ *StorageBucketAcl) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Storage
// terraformStorageBucketAcl is the model for a terraform google_storage_bucket_acl rule
type terraformStorageBucketAcl struct {
Bucket string `json:"bucket,omitempty" cty:"bucket"`
RoleEntity []string `json:"role_entity,omitempty" cty:"role_entity"`
Bucket string `cty:"bucket"`
RoleEntity []string `cty:"role_entity"`
}
func (_ *StorageBucketAcl) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *StorageBucketAcl) error {

View File

@ -126,9 +126,9 @@ func (_ *StorageBucketIAM) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Storage
// terraformStorageBucketIAM is the model for a terraform google_storage_bucket_iam_member rule
type terraformStorageBucketIAM struct {
Bucket string `json:"bucket,omitempty" cty:"bucket"`
Role string `json:"role,omitempty" cty:"role"`
Member string `json:"member,omitempty" cty:"member"`
Bucket string `cty:"bucket"`
Role string `cty:"role"`
Member string `cty:"member"`
}
func (_ *StorageBucketIAM) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *StorageBucketIAM) error {

View File

@ -124,9 +124,9 @@ func (_ *StorageObjectAcl) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Storage
// terraformStorageObjectAcl is the model for a terraform google_storage_object_acl rule
type terraformStorageObjectAcl struct {
Bucket string `json:"bucket,omitempty" cty:"bucket"`
Object string `json:"object,omitempty" cty:"object"`
RoleEntity []string `json:"role_entity,omitempty" cty:"role_entity"`
Bucket string `cty:"bucket"`
Object string `cty:"object"`
RoleEntity []string `cty:"role_entity"`
}
func (_ *StorageObjectAcl) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *StorageObjectAcl) error {

View File

@ -232,18 +232,18 @@ func (e *Subnet) URL(project string, region string) string {
}
type terraformSubnet struct {
Name *string `json:"name" cty:"name"`
Network *terraformWriter.Literal `json:"network" cty:"network"`
Region *string `json:"region" cty:"region"`
CIDR *string `json:"ip_cidr_range" cty:"ip_cidr_range"`
Name *string `cty:"name"`
Network *terraformWriter.Literal `cty:"network"`
Region *string `cty:"region"`
CIDR *string `cty:"ip_cidr_range"`
// SecondaryIPRange defines additional IP ranges
SecondaryIPRange []terraformSubnetRange `json:"secondary_ip_range,omitempty" cty:"secondary_ip_range"`
SecondaryIPRange []terraformSubnetRange `cty:"secondary_ip_range"`
}
type terraformSubnetRange struct {
Name string `json:"range_name,omitempty" cty:"range_name"`
CIDR string `json:"ip_cidr_range,omitempty" cty:"ip_cidr_range"`
Name string `cty:"range_name"`
CIDR string `cty:"ip_cidr_range"`
}
func (_ *Subnet) RenderSubnet(t *terraform.TerraformTarget, a, e, changes *Subnet) error {

View File

@ -104,11 +104,11 @@ func (_ *TargetPool) RenderGCE(t *gce.GCEAPITarget, a, e, changes *TargetPool) e
}
type terraformTargetPool struct {
Name string `json:"name" cty:"name"`
Description string `json:"description,omitempty" cty:"description"`
HealthChecks []string `json:"health_checks,omitempty" cty:"health_checks"`
Instances []string `json:"instances,omitempty" cty:"instances"`
SessionAffinity string `json:"session_affinity,omitempty" cty:"session_affinity"`
Name string `cty:"name"`
Description string `cty:"description"`
HealthChecks []string `cty:"health_checks"`
Instances []string `cty:"instances"`
SessionAffinity string `cty:"session_affinity"`
}
func (_ *TargetPool) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *TargetPool) error {

View File

@ -1352,110 +1352,110 @@ func (_ *Elastigroup) update(cloud awsup.AWSCloud, a, e, changes *Elastigroup) e
}
type terraformElastigroup struct {
Name *string `json:"name,omitempty" cty:"name"`
Description *string `json:"description,omitempty" cty:"description"`
Product *string `json:"product,omitempty" cty:"product"`
Region *string `json:"region,omitempty" cty:"region"`
SubnetIDs []*terraformWriter.Literal `json:"subnet_ids,omitempty" cty:"subnet_ids"`
LoadBalancers []*terraformWriter.Literal `json:"elastic_load_balancers,omitempty" cty:"elastic_load_balancers"`
TargetGroups []*terraformWriter.Literal `json:"target_group_arns,omitempty" cty:"target_group_arns"`
NetworkInterfaces []*terraformElastigroupNetworkInterface `json:"network_interface,omitempty" cty:"network_interface"`
RootBlockDevice *terraformElastigroupBlockDevice `json:"ebs_block_device,omitempty" cty:"ebs_block_device"`
EphemeralBlockDevice []*terraformElastigroupBlockDevice `json:"ephemeral_block_device,omitempty" cty:"ephemeral_block_device"`
Integration *terraformElastigroupIntegration `json:"integration_kubernetes,omitempty" cty:"integration_kubernetes"`
Tags []*terraformKV `json:"tags,omitempty" cty:"tags"`
Name *string `cty:"name"`
Description *string `cty:"description"`
Product *string `cty:"product"`
Region *string `cty:"region"`
SubnetIDs []*terraformWriter.Literal `cty:"subnet_ids"`
LoadBalancers []*terraformWriter.Literal `cty:"elastic_load_balancers"`
TargetGroups []*terraformWriter.Literal `cty:"target_group_arns"`
NetworkInterfaces []*terraformElastigroupNetworkInterface `cty:"network_interface"`
RootBlockDevice *terraformElastigroupBlockDevice `cty:"ebs_block_device"`
EphemeralBlockDevice []*terraformElastigroupBlockDevice `cty:"ephemeral_block_device"`
Integration *terraformElastigroupIntegration `cty:"integration_kubernetes"`
Tags []*terraformKV `cty:"tags"`
MinSize *int64 `json:"min_size,omitempty" cty:"min_size"`
MaxSize *int64 `json:"max_size,omitempty" cty:"max_size"`
DesiredCapacity *int64 `json:"desired_capacity,omitempty" cty:"desired_capacity"`
CapacityUnit *string `json:"capacity_unit,omitempty" cty:"capacity_unit"`
MinSize *int64 `cty:"min_size"`
MaxSize *int64 `cty:"max_size"`
DesiredCapacity *int64 `cty:"desired_capacity"`
CapacityUnit *string `cty:"capacity_unit"`
SpotPercentage *float64 `json:"spot_percentage,omitempty" cty:"spot_percentage"`
Orientation *string `json:"orientation,omitempty" cty:"orientation"`
FallbackToOnDemand *bool `json:"fallback_to_ondemand,omitempty" cty:"fallback_to_ondemand"`
UtilizeReservedInstances *bool `json:"utilize_reserved_instances,omitempty" cty:"utilize_reserved_instances"`
UtilizeCommitments *bool `json:"utilize_commitments,omitempty" cty:"utilize_commitments"`
DrainingTimeout *int64 `json:"draining_timeout,omitempty" cty:"draining_timeout"`
SpotPercentage *float64 `cty:"spot_percentage"`
Orientation *string `cty:"orientation"`
FallbackToOnDemand *bool `cty:"fallback_to_ondemand"`
UtilizeReservedInstances *bool `cty:"utilize_reserved_instances"`
UtilizeCommitments *bool `cty:"utilize_commitments"`
DrainingTimeout *int64 `cty:"draining_timeout"`
OnDemand *string `json:"instance_types_ondemand,omitempty" cty:"instance_types_ondemand"`
Spot []string `json:"instance_types_spot,omitempty" cty:"instance_types_spot"`
OnDemand *string `cty:"instance_types_ondemand"`
Spot []string `cty:"instance_types_spot"`
Monitoring *bool `json:"enable_monitoring,omitempty" cty:"enable_monitoring"`
EBSOptimized *bool `json:"ebs_optimized,omitempty" cty:"ebs_optimized"`
ImageID *string `json:"image_id,omitempty" cty:"image_id"`
HealthCheckType *string `json:"health_check_type,omitempty" cty:"health_check_type"`
SecurityGroups []*terraformWriter.Literal `json:"security_groups,omitempty" cty:"security_groups"`
UserData *terraformWriter.Literal `json:"user_data,omitempty" cty:"user_data"`
IAMInstanceProfile *terraformWriter.Literal `json:"iam_instance_profile,omitempty" cty:"iam_instance_profile"`
KeyName *terraformWriter.Literal `json:"key_name,omitempty" cty:"key_name"`
Monitoring *bool `cty:"enable_monitoring"`
EBSOptimized *bool `cty:"ebs_optimized"`
ImageID *string `cty:"image_id"`
HealthCheckType *string `cty:"health_check_type"`
SecurityGroups []*terraformWriter.Literal `cty:"security_groups"`
UserData *terraformWriter.Literal `cty:"user_data"`
IAMInstanceProfile *terraformWriter.Literal `cty:"iam_instance_profile"`
KeyName *terraformWriter.Literal `cty:"key_name"`
}
type terraformElastigroupBlockDevice struct {
DeviceName *string `json:"device_name,omitempty" cty:"device_name"`
VirtualName *string `json:"virtual_name,omitempty" cty:"virtual_name"`
VolumeType *string `json:"volume_type,omitempty" cty:"volume_type"`
VolumeSize *int64 `json:"volume_size,omitempty" cty:"volume_size"`
VolumeIOPS *int64 `json:"iops,omitempty" cty:"iops"`
VolumeThroughput *int64 `json:"throughput,omitempty" cty:"throughput"`
DeleteOnTermination *bool `json:"delete_on_termination,omitempty" cty:"delete_on_termination"`
DeviceName *string `cty:"device_name"`
VirtualName *string `cty:"virtual_name"`
VolumeType *string `cty:"volume_type"`
VolumeSize *int64 `cty:"volume_size"`
VolumeIOPS *int64 `cty:"iops"`
VolumeThroughput *int64 `cty:"throughput"`
DeleteOnTermination *bool `cty:"delete_on_termination"`
}
type terraformElastigroupNetworkInterface struct {
Description *string `json:"description,omitempty" cty:"description"`
DeviceIndex *int `json:"device_index,omitempty" cty:"device_index"`
AssociatePublicIPAddress *bool `json:"associate_public_ip_address,omitempty" cty:"associate_public_ip_address"`
DeleteOnTermination *bool `json:"delete_on_termination,omitempty" cty:"delete_on_termination"`
Description *string `cty:"description"`
DeviceIndex *int `cty:"device_index"`
AssociatePublicIPAddress *bool `cty:"associate_public_ip_address"`
DeleteOnTermination *bool `cty:"delete_on_termination"`
}
type terraformElastigroupIntegration struct {
IntegrationMode *string `json:"integration_mode,omitempty" cty:"integration_mode"`
ClusterIdentifier *string `json:"cluster_identifier,omitempty" cty:"cluster_identifier"`
IntegrationMode *string `cty:"integration_mode"`
ClusterIdentifier *string `cty:"cluster_identifier"`
Enabled *bool `json:"autoscale_is_enabled,omitempty" cty:"autoscale_is_enabled"`
AutoConfig *bool `json:"autoscale_is_auto_config,omitempty" cty:"autoscale_is_auto_config"`
Cooldown *int `json:"autoscale_cooldown,omitempty" cty:"autoscale_cooldown"`
Headroom *terraformAutoScalerHeadroom `json:"autoscale_headroom,omitempty" cty:"autoscale_headroom"`
Down *terraformAutoScalerDown `json:"autoscale_down,omitempty" cty:"autoscale_down"`
Labels []*terraformKV `json:"autoscale_labels,omitempty" cty:"autoscale_labels"`
Enabled *bool `cty:"autoscale_is_enabled"`
AutoConfig *bool `cty:"autoscale_is_auto_config"`
Cooldown *int `cty:"autoscale_cooldown"`
Headroom *terraformAutoScalerHeadroom `cty:"autoscale_headroom"`
Down *terraformAutoScalerDown `cty:"autoscale_down"`
Labels []*terraformKV `cty:"autoscale_labels"`
}
type terraformAutoScaler struct {
Enabled *bool `json:"autoscale_is_enabled,omitempty" cty:"autoscale_is_enabled"`
AutoConfig *bool `json:"autoscale_is_auto_config,omitempty" cty:"autoscale_is_auto_config"`
AutoHeadroomPercentage *int `json:"auto_headroom_percentage,omitempty" cty:"auto_headroom_percentage"`
Cooldown *int `json:"autoscale_cooldown,omitempty" cty:"autoscale_cooldown"`
Headroom *terraformAutoScalerHeadroom `json:"autoscale_headroom,omitempty" cty:"autoscale_headroom"`
Down *terraformAutoScalerDown `json:"autoscale_down,omitempty" cty:"autoscale_down"`
ResourceLimits *terraformAutoScalerResourceLimits `json:"resource_limits,omitempty" cty:"resource_limits"`
Labels []*terraformKV `json:"autoscale_labels,omitempty" cty:"autoscale_labels"`
Enabled *bool `cty:"autoscale_is_enabled"`
AutoConfig *bool `cty:"autoscale_is_auto_config"`
AutoHeadroomPercentage *int `cty:"auto_headroom_percentage"`
Cooldown *int `cty:"autoscale_cooldown"`
Headroom *terraformAutoScalerHeadroom `cty:"autoscale_headroom"`
Down *terraformAutoScalerDown `cty:"autoscale_down"`
ResourceLimits *terraformAutoScalerResourceLimits `cty:"resource_limits"`
Labels []*terraformKV `cty:"autoscale_labels"`
}
type terraformAutoScalerHeadroom struct {
CPUPerUnit *int `json:"cpu_per_unit,omitempty" cty:"cpu_per_unit"`
GPUPerUnit *int `json:"gpu_per_unit,omitempty" cty:"gpu_per_unit"`
MemPerUnit *int `json:"memory_per_unit,omitempty" cty:"memory_per_unit"`
NumOfUnits *int `json:"num_of_units,omitempty" cty:"num_of_units"`
CPUPerUnit *int `cty:"cpu_per_unit"`
GPUPerUnit *int `cty:"gpu_per_unit"`
MemPerUnit *int `cty:"memory_per_unit"`
NumOfUnits *int `cty:"num_of_units"`
}
type terraformAutoScalerDown struct {
MaxPercentage *float64 `json:"max_scale_down_percentage,omitempty" cty:"max_scale_down_percentage"`
EvaluationPeriods *int `json:"evaluation_periods,omitempty" cty:"evaluation_periods"`
MaxPercentage *float64 `cty:"max_scale_down_percentage"`
EvaluationPeriods *int `cty:"evaluation_periods"`
}
type terraformAutoScalerResourceLimits struct {
MaxVCPU *int `json:"max_vcpu,omitempty" cty:"max_vcpu"`
MaxMemory *int `json:"max_memory_gib,omitempty" cty:"max_memory_gib"`
MaxVCPU *int `cty:"max_vcpu"`
MaxMemory *int `cty:"max_memory_gib"`
}
type terraformKV struct {
Key *string `json:"key" cty:"key"`
Value *string `json:"value" cty:"value"`
Key *string `cty:"key"`
Value *string `cty:"value"`
}
type terraformTaint struct {
Key *string `json:"key" cty:"key"`
Value *string `json:"value" cty:"value"`
Effect *string `json:"effect" cty:"effect"`
Key *string `cty:"key"`
Value *string `cty:"value"`
Effect *string `cty:"effect"`
}
func (_ *Elastigroup) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Elastigroup) error {

View File

@ -773,45 +773,45 @@ func (_ *LaunchSpec) update(cloud awsup.AWSCloud, a, e, changes *LaunchSpec) err
}
type terraformLaunchSpec struct {
Name *string `json:"name,omitempty" cty:"name"`
OceanID *terraformWriter.Literal `json:"ocean_id,omitempty" cty:"ocean_id"`
Name *string `cty:"name"`
OceanID *terraformWriter.Literal `cty:"ocean_id"`
Monitoring *bool `json:"monitoring,omitempty" cty:"monitoring"`
EBSOptimized *bool `json:"ebs_optimized,omitempty" cty:"ebs_optimized"`
ImageID *string `json:"image_id,omitempty" cty:"image_id"`
AssociatePublicIPAddress *bool `json:"associate_public_ip_address,omitempty" cty:"associate_public_ip_address"`
RestrictScaleDown *bool `json:"restrict_scale_down,omitempty" cty:"restrict_scale_down"`
RootVolumeSize *int64 `json:"root_volume_size,omitempty" cty:"root_volume_size"`
UserData *terraformWriter.Literal `json:"user_data,omitempty" cty:"user_data"`
IAMInstanceProfile *terraformWriter.Literal `json:"iam_instance_profile,omitempty" cty:"iam_instance_profile"`
KeyName *terraformWriter.Literal `json:"key_name,omitempty" cty:"key_name"`
InstanceTypes []string `json:"instance_types,omitempty" cty:"instance_types"`
SubnetIDs []*terraformWriter.Literal `json:"subnet_ids,omitempty" cty:"subnet_ids"`
SecurityGroups []*terraformWriter.Literal `json:"security_groups,omitempty" cty:"security_groups"`
Taints []*terraformTaint `json:"taints,omitempty" cty:"taints"`
Labels []*terraformKV `json:"labels,omitempty" cty:"labels"`
Tags []*terraformKV `json:"tags,omitempty" cty:"tags"`
Headrooms []*terraformAutoScalerHeadroom `json:"autoscale_headrooms,omitempty" cty:"autoscale_headrooms"`
BlockDeviceMappings []*terraformBlockDeviceMapping `json:"block_device_mappings,omitempty" cty:"block_device_mappings"`
Strategy *terraformLaunchSpecStrategy `json:"strategy,omitempty" cty:"strategy"`
Monitoring *bool `cty:"monitoring"`
EBSOptimized *bool `cty:"ebs_optimized"`
ImageID *string `cty:"image_id"`
AssociatePublicIPAddress *bool `cty:"associate_public_ip_address"`
RestrictScaleDown *bool `cty:"restrict_scale_down"`
RootVolumeSize *int64 `cty:"root_volume_size"`
UserData *terraformWriter.Literal `cty:"user_data"`
IAMInstanceProfile *terraformWriter.Literal `cty:"iam_instance_profile"`
KeyName *terraformWriter.Literal `cty:"key_name"`
InstanceTypes []string `cty:"instance_types"`
SubnetIDs []*terraformWriter.Literal `cty:"subnet_ids"`
SecurityGroups []*terraformWriter.Literal `cty:"security_groups"`
Taints []*terraformTaint `cty:"taints"`
Labels []*terraformKV `cty:"labels"`
Tags []*terraformKV `cty:"tags"`
Headrooms []*terraformAutoScalerHeadroom `cty:"autoscale_headrooms"`
BlockDeviceMappings []*terraformBlockDeviceMapping `cty:"block_device_mappings"`
Strategy *terraformLaunchSpecStrategy `cty:"strategy"`
}
type terraformLaunchSpecStrategy struct {
SpotPercentage *int64 `json:"spot_percentage,omitempty" cty:"spot_percentage"`
SpotPercentage *int64 `cty:"spot_percentage"`
}
type terraformBlockDeviceMapping struct {
DeviceName *string `json:"device_name,omitempty" cty:"device_name"`
EBS *terraformBlockDeviceMappingEBS `json:"ebs,omitempty" cty:"ebs"`
DeviceName *string `cty:"device_name"`
EBS *terraformBlockDeviceMappingEBS `cty:"ebs"`
}
type terraformBlockDeviceMappingEBS struct {
VirtualName *string `json:"virtual_name,omitempty" cty:"virtual_name"`
VolumeType *string `json:"volume_type,omitempty" cty:"volume_type"`
VolumeSize *int64 `json:"volume_size,omitempty" cty:"volume_size"`
VolumeIOPS *int64 `json:"iops,omitempty" cty:"iops"`
VolumeThroughput *int64 `json:"throughput,omitempty" cty:"throughput"`
DeleteOnTermination *bool `json:"delete_on_termination,omitempty" cty:"delete_on_termination"`
VirtualName *string `cty:"virtual_name"`
VolumeType *string `cty:"volume_type"`
VolumeSize *int64 `cty:"volume_size"`
VolumeIOPS *int64 `cty:"iops"`
VolumeThroughput *int64 `cty:"throughput"`
DeleteOnTermination *bool `cty:"delete_on_termination"`
}
func (_ *LaunchSpec) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *LaunchSpec) error {

View File

@ -994,34 +994,34 @@ func (_ *Ocean) update(cloud awsup.AWSCloud, a, e, changes *Ocean) error {
}
type terraformOcean struct {
Name *string `json:"name,omitempty" cty:"name"`
ControllerClusterID *string `json:"controller_id,omitempty" cty:"controller_id"`
Region *string `json:"region,omitempty" cty:"region"`
InstanceTypesWhitelist []string `json:"whitelist,omitempty" cty:"whitelist"`
InstanceTypesBlacklist []string `json:"blacklist,omitempty" cty:"blacklist"`
SubnetIDs []*terraformWriter.Literal `json:"subnet_ids,omitempty" cty:"subnet_ids"`
AutoScaler *terraformAutoScaler `json:"autoscaler,omitempty" cty:"autoscaler"`
Tags []*terraformKV `json:"tags,omitempty" cty:"tags"`
Name *string `cty:"name"`
ControllerClusterID *string `cty:"controller_id"`
Region *string `cty:"region"`
InstanceTypesWhitelist []string `cty:"whitelist"`
InstanceTypesBlacklist []string `cty:"blacklist"`
SubnetIDs []*terraformWriter.Literal `cty:"subnet_ids"`
AutoScaler *terraformAutoScaler `cty:"autoscaler"`
Tags []*terraformKV `cty:"tags"`
MinSize *int64 `json:"min_size,omitempty" cty:"min_size"`
MaxSize *int64 `json:"max_size,omitempty" cty:"max_size"`
DesiredCapacity *int64 `json:"desired_capacity,omitempty" cty:"desired_capacity"`
MinSize *int64 `cty:"min_size"`
MaxSize *int64 `cty:"max_size"`
DesiredCapacity *int64 `cty:"desired_capacity"`
FallbackToOnDemand *bool `json:"fallback_to_ondemand,omitempty" cty:"fallback_to_ondemand"`
UtilizeReservedInstances *bool `json:"utilize_reserved_instances,omitempty" cty:"utilize_reserved_instances"`
UtilizeCommitments *bool `json:"utilize_commitments,omitempty" cty:"utilize_commitments"`
DrainingTimeout *int64 `json:"draining_timeout,omitempty" cty:"draining_timeout"`
GracePeriod *int64 `json:"grace_period,omitempty" cty:"grace_period"`
FallbackToOnDemand *bool `cty:"fallback_to_ondemand"`
UtilizeReservedInstances *bool `cty:"utilize_reserved_instances"`
UtilizeCommitments *bool `cty:"utilize_commitments"`
DrainingTimeout *int64 `cty:"draining_timeout"`
GracePeriod *int64 `cty:"grace_period"`
Monitoring *bool `json:"monitoring,omitempty" cty:"monitoring"`
EBSOptimized *bool `json:"ebs_optimized,omitempty" cty:"ebs_optimized"`
ImageID *string `json:"image_id,omitempty" cty:"image_id"`
AssociatePublicIPAddress *bool `json:"associate_public_ip_address,omitempty" cty:"associate_public_ip_address"`
RootVolumeSize *int64 `json:"root_volume_size,omitempty" cty:"root_volume_size"`
UserData *terraformWriter.Literal `json:"user_data,omitempty" cty:"user_data"`
IAMInstanceProfile *terraformWriter.Literal `json:"iam_instance_profile,omitempty" cty:"iam_instance_profile"`
KeyName *terraformWriter.Literal `json:"key_name,omitempty" cty:"key_name"`
SecurityGroups []*terraformWriter.Literal `json:"security_groups,omitempty" cty:"security_groups"`
Monitoring *bool `cty:"monitoring"`
EBSOptimized *bool `cty:"ebs_optimized"`
ImageID *string `cty:"image_id"`
AssociatePublicIPAddress *bool `cty:"associate_public_ip_address"`
RootVolumeSize *int64 `cty:"root_volume_size"`
UserData *terraformWriter.Literal `cty:"user_data"`
IAMInstanceProfile *terraformWriter.Literal `cty:"iam_instance_profile"`
KeyName *terraformWriter.Literal `cty:"key_name"`
SecurityGroups []*terraformWriter.Literal `cty:"security_groups"`
}
func (_ *Ocean) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Ocean) error {

View File

@ -7,7 +7,6 @@ go_library(
"lifecycle.go",
"target.go",
"target_hcl2.go",
"target_json.go",
],
importpath = "k8s.io/kops/upup/pkg/fi/cloudup/terraform",
visibility = ["//visibility:public"],

View File

@ -17,6 +17,6 @@ limitations under the License.
package terraform
type Lifecycle struct {
PreventDestroy *bool `json:"prevent_destroy,omitempty" cty:"prevent_destroy"`
CreateBeforeDestroy *bool `json:"create_before_destroy,omitempty" cty:"create_before_destroy"`
PreventDestroy *bool `cty:"prevent_destroy"`
CreateBeforeDestroy *bool `cty:"create_before_destroy"`
}

View File

@ -17,14 +17,12 @@ limitations under the License.
package terraform
import (
"errors"
"fmt"
"os"
"path"
"k8s.io/klog/v2"
"k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/featureflag"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup/terraformWriter"
"k8s.io/kops/util/pkg/vfs"
@ -94,24 +92,14 @@ func tfGetFilesProviderExtraConfig(c *kops.TargetSpec) map[string]string {
}
func (t *TerraformTarget) Finish(taskMap map[string]fi.Task) error {
var err error
if featureflag.TerraformJSON.Enabled() {
if featureflag.TerraformManagedFiles.Enabled() {
// Terraform's JSON representation doesn't support provider aliases which are required for managed files
return errors.New("TerraformJSON cannot be used with TerraformManagedFiles")
}
err = t.finishJSON()
} else {
err = t.finishHCL2()
}
if err != nil {
if err := t.finishHCL2(); err != nil {
return err
}
for relativePath, contents := range t.Files {
p := path.Join(t.outDir, relativePath)
err = os.MkdirAll(path.Dir(p), os.FileMode(0o755))
err := os.MkdirAll(path.Dir(p), os.FileMode(0o755))
if err != nil {
return fmt.Errorf("error creating output directory %q: %v", path.Dir(p), err)
}

View File

@ -1,114 +0,0 @@
/*
Copyright 2020 The Kubernetes Authors.
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 terraform
import (
"encoding/json"
"fmt"
"k8s.io/kops/pkg/apis/kops"
)
func (t *TerraformTarget) finishJSON() error {
resourcesByType, err := t.GetResourcesByType()
if err != nil {
return err
}
providersByName := make(map[string]map[string]interface{})
if t.Cloud.ProviderID() == kops.CloudProviderGCE {
providerGoogle := make(map[string]interface{})
providerGoogle["project"] = t.Project
providerGoogle["region"] = t.Cloud.Region()
for k, v := range tfGetProviderExtraConfig(t.clusterSpecTarget) {
providerGoogle[k] = v
}
providersByName["google"] = providerGoogle
} else if t.Cloud.ProviderID() == kops.CloudProviderAWS {
providerAWS := make(map[string]interface{})
providerAWS["region"] = t.Cloud.Region()
for k, v := range tfGetProviderExtraConfig(t.clusterSpecTarget) {
providerAWS[k] = v
}
providersByName["aws"] = providerAWS
}
outputs, err := t.GetOutputs()
if err != nil {
return err
}
outputVariables := make(map[string]interface{})
localVariables := make(map[string]interface{})
for tfName, v := range outputs {
var tfVar interface{}
if v.Value != nil {
tfVar = v.Value
} else {
tfVar = v.ValueArray
}
outputVariables[tfName] = map[string]interface{}{"value": tfVar}
localVariables[tfName] = tfVar
}
data := make(map[string]interface{})
data["resource"] = resourcesByType
if len(providersByName) != 0 {
data["provider"] = providersByName
}
if len(outputVariables) != 0 {
data["output"] = outputVariables
}
if len(localVariables) != 0 {
data["locals"] = localVariables
}
terraformConfiguration := make(map[string]interface{})
terraformConfiguration["required_version"] = ">= 0.12.26"
requiredProvidersByName := make(map[string]interface{})
if t.Cloud.ProviderID() == kops.CloudProviderGCE {
requiredProviderGoogle := make(map[string]interface{})
requiredProviderGoogle["source"] = "hashicorp/google"
requiredProviderGoogle["version"] = ">= 2.19.0"
for k, v := range tfGetProviderExtraConfig(t.clusterSpecTarget) {
requiredProviderGoogle[k] = v
}
requiredProvidersByName["google"] = requiredProviderGoogle
} else if t.Cloud.ProviderID() == kops.CloudProviderAWS {
requiredProviderAWS := make(map[string]interface{})
requiredProviderAWS["source"] = "hashicorp/aws"
requiredProviderAWS["version"] = ">= 3.59.0"
for k, v := range tfGetProviderExtraConfig(t.clusterSpecTarget) {
requiredProviderAWS[k] = v
}
requiredProvidersByName["aws"] = requiredProviderAWS
}
if len(requiredProvidersByName) != 0 {
terraformConfiguration["required_providers"] = requiredProvidersByName
}
data["terraform"] = terraformConfiguration
jsonBytes, err := json.MarshalIndent(data, "", " ")
if err != nil {
return fmt.Errorf("error marshaling terraform data to json: %v", err)
}
t.Files["kubernetes.tf.json"] = jsonBytes
return nil
}

View File

@ -27,8 +27,7 @@ import (
// Literal represents a literal in terraform syntax
type Literal struct {
// Value is only used in JSON output via the TerraformJSON feature flag
// "${}" interpolation is supported.
// Value is used to support Terraform's "${}" interpolation
Value string `cty:"value"`
// Tokens are portions of a literal reference joined by periods.