driftctl/pkg/resource/aws/aws_route.go

84 lines
3.1 KiB
Go

// GENERATED, DO NOT EDIT THIS FILE
package aws
import (
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/zclconf/go-cty/cty"
)
const AwsRouteResourceType = "aws_route"
type AwsRoute struct {
DestinationCidrBlock *string `cty:"destination_cidr_block"`
DestinationIpv6CidrBlock *string `cty:"destination_ipv6_cidr_block"`
DestinationPrefixListId *string `cty:"destination_prefix_list_id" computed:"true"`
EgressOnlyGatewayId *string `cty:"egress_only_gateway_id" computed:"true"`
GatewayId *string `cty:"gateway_id" computed:"true"`
Id string `cty:"id" computed:"true"`
InstanceId *string `cty:"instance_id" computed:"true"`
InstanceOwnerId *string `cty:"instance_owner_id" computed:"true"`
LocalGatewayId *string `cty:"local_gateway_id" computed:"true"`
NatGatewayId *string `cty:"nat_gateway_id" computed:"true"`
NetworkInterfaceId *string `cty:"network_interface_id" computed:"true"`
Origin *string `cty:"origin" computed:"true"`
RouteTableId *string `cty:"route_table_id"`
State *string `cty:"state" computed:"true"`
TransitGatewayId *string `cty:"transit_gateway_id"`
VpcEndpointId *string `cty:"vpc_endpoint_id"`
VpcPeeringConnectionId *string `cty:"vpc_peering_connection_id"`
Timeouts *struct {
Create *string `cty:"create"`
Delete *string `cty:"delete"`
} `cty:"timeouts" diff:"-"`
CtyVal *cty.Value `diff:"-"`
}
func (r *AwsRoute) TerraformId() string {
return r.Id
}
func (r *AwsRoute) TerraformType() string {
return AwsRouteResourceType
}
func (r *AwsRoute) CtyValue() *cty.Value {
return r.CtyVal
}
func initAwsRouteMetaData(resourceSchemaRepository resource.SchemaRepositoryInterface) {
resourceSchemaRepository.SetNormalizeFunc(AwsRouteResourceType, func(val *resource.Attributes) {
val.SafeDelete([]string{"timeouts"})
if v, exist := val.Get("vpc_endpoint_id"); exist && v == "" {
val.SafeDelete([]string{"vpc_endpoint_id"})
}
if v, exist := val.Get("local_gateway_id"); exist && v == "" {
val.SafeDelete([]string{"local_gateway_id"})
}
if v, exist := val.Get("destination_cidr_block"); exist && v == "" {
val.SafeDelete([]string{"destination_cidr_block"})
}
if v, exist := val.Get("destination_ipv6_cidr_block"); exist && v == "" {
val.SafeDelete([]string{"destination_ipv6_cidr_block"})
}
if v, exist := val.Get("egress_only_gateway_id"); exist && v == "" {
val.SafeDelete([]string{"egress_only_gateway_id"})
}
if v, exist := val.Get("nat_gateway_id"); exist && v == "" {
val.SafeDelete([]string{"nat_gateway_id"})
}
if v, exist := val.Get("instance_id"); exist && v == "" {
val.SafeDelete([]string{"instance_id"})
}
if v, exist := val.Get("network_interface_id"); exist && v == "" {
val.SafeDelete([]string{"network_interface_id"})
}
if v, exist := val.Get("transit_gateway_id"); exist && v == "" {
val.SafeDelete([]string{"transit_gateway_id"})
}
if v, exist := val.Get("vpc_peering_connection_id"); exist && v == "" {
val.SafeDelete([]string{"vpc_peering_connection_id"})
}
})
}