// Code generated by generators/resource/main.go; DO NOT EDIT. package ec2 import ( "context" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { registry.AddResourceTypeFactory("awscc_ec2_flow_log", flowLogResourceType) } // flowLogResourceType returns the Terraform awscc_ec2_flow_log resource type. // This Terraform resource type corresponds to the CloudFormation AWS::EC2::FlowLog resource type. func flowLogResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "deliver_logs_permission_arn": { // Property: DeliverLogsPermissionArn // CloudFormation resource type schema: // { // "description": "The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.", // "type": "string" // } Description: "The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.", Type: types.StringType, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "destination_options": { // Property: DestinationOptions // CloudFormation resource type schema: // { // "additionalProperties": false, // "properties": { // "FileFormat": { // "enum": [ // "plain-text", // "parquet" // ], // "type": "string" // }, // "HiveCompatiblePartitions": { // "type": "boolean" // }, // "PerHourPartition": { // "type": "boolean" // } // }, // "required": [ // "FileFormat", // "HiveCompatiblePartitions", // "PerHourPartition" // ], // "type": "object" // } Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "file_format": { // Property: FileFormat Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "plain-text", "parquet", }), }, }, "hive_compatible_partitions": { // Property: HiveCompatiblePartitions Type: types.BoolType, Required: true, }, "per_hour_partition": { // Property: PerHourPartition Type: types.BoolType, Required: true, }, }, ), Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "id": { // Property: Id // CloudFormation resource type schema: // { // "description": "The Flow Log ID", // "type": "string" // } Description: "The Flow Log ID", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "log_destination": { // Property: LogDestination // CloudFormation resource type schema: // { // "description": "Specifies the destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The value specified for this parameter depends on the value specified for LogDestinationType.", // "type": "string" // } Description: "Specifies the destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The value specified for this parameter depends on the value specified for LogDestinationType.", Type: types.StringType, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "log_destination_type": { // Property: LogDestinationType // CloudFormation resource type schema: // { // "description": "Specifies the type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3.", // "enum": [ // "cloud-watch-logs", // "s3", // "kinesis-data-firehose" // ], // "type": "string" // } Description: "Specifies the type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "cloud-watch-logs", "s3", "kinesis-data-firehose", }), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "log_format": { // Property: LogFormat // CloudFormation resource type schema: // { // "description": "The fields to include in the flow log record, in the order in which they should appear.", // "type": "string" // } Description: "The fields to include in the flow log record, in the order in which they should appear.", Type: types.StringType, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "log_group_name": { // Property: LogGroupName // CloudFormation resource type schema: // { // "description": "The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.", // "type": "string" // } Description: "The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.", Type: types.StringType, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "max_aggregation_interval": { // Property: MaxAggregationInterval // CloudFormation resource type schema: // { // "description": "The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).", // "type": "integer" // } Description: "The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).", Type: types.Int64Type, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "resource_id": { // Property: ResourceId // CloudFormation resource type schema: // { // "description": "The ID of the subnet, network interface, or VPC for which you want to create a flow log.", // "type": "string" // } Description: "The ID of the subnet, network interface, or VPC for which you want to create a flow log.", Type: types.StringType, Required: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "resource_type": { // Property: ResourceType // CloudFormation resource type schema: // { // "description": "The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId property, specify VPC for this property.", // "enum": [ // "NetworkInterface", // "Subnet", // "VPC" // ], // "type": "string" // } Description: "The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId property, specify VPC for this property.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "NetworkInterface", "Subnet", "VPC", }), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "description": "The tags to apply to the flow logs.", // "items": { // "additionalProperties": false, // "properties": { // "Key": { // "type": "string" // }, // "Value": { // "type": "string" // } // }, // "required": [ // "Value", // "Key" // ], // "type": "object" // }, // "type": "array", // "uniqueItems": false // } Description: "The tags to apply to the flow logs.", Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "key": { // Property: Key Type: types.StringType, Required: true, }, "value": { // Property: Value Type: types.StringType, Required: true, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, }, "traffic_type": { // Property: TrafficType // CloudFormation resource type schema: // { // "description": "The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.", // "enum": [ // "ACCEPT", // "ALL", // "REJECT" // ], // "type": "string" // } Description: "The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "ACCEPT", "ALL", "REJECT", }), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, } schema := tfsdk.Schema{ Description: "Specifies a VPC flow log, which enables you to capture IP traffic for a specific network interface, subnet, or VPC.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::EC2::FlowLog").WithTerraformTypeName("awscc_ec2_flow_log") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(false) opts = opts.WithAttributeNameMap(map[string]string{ "deliver_logs_permission_arn": "DeliverLogsPermissionArn", "destination_options": "DestinationOptions", "file_format": "FileFormat", "hive_compatible_partitions": "HiveCompatiblePartitions", "id": "Id", "key": "Key", "log_destination": "LogDestination", "log_destination_type": "LogDestinationType", "log_format": "LogFormat", "log_group_name": "LogGroupName", "max_aggregation_interval": "MaxAggregationInterval", "per_hour_partition": "PerHourPartition", "resource_id": "ResourceId", "resource_type": "ResourceType", "tags": "Tags", "traffic_type": "TrafficType", "value": "Value", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }