// Code generated by generators/resource/main.go; DO NOT EDIT. package greengrassv2 import ( "context" "regexp" "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_greengrassv2_component_version", componentVersionResourceType) } // componentVersionResourceType returns the Terraform awscc_greengrassv2_component_version resource type. // This Terraform resource type corresponds to the CloudFormation AWS::GreengrassV2::ComponentVersion resource type. func componentVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "arn": { // Property: Arn // CloudFormation resource type schema: // { // "type": "string" // } Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "component_name": { // Property: ComponentName // CloudFormation resource type schema: // { // "type": "string" // } Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "component_version": { // Property: ComponentVersion // CloudFormation resource type schema: // { // "type": "string" // } Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "inline_recipe": { // Property: InlineRecipe // CloudFormation resource type schema: // { // "type": "string" // } Type: types.StringType, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, // InlineRecipe is a write-only property. }, "lambda_function": { // Property: LambdaFunction // CloudFormation resource type schema: // { // "additionalProperties": false, // "properties": { // "ComponentDependencies": { // "additionalProperties": false, // "patternProperties": { // "": { // "additionalProperties": false, // "properties": { // "DependencyType": { // "enum": [ // "SOFT", // "HARD" // ], // "type": "string" // }, // "VersionRequirement": { // "type": "string" // } // }, // "type": "object" // } // }, // "type": "object" // }, // "ComponentLambdaParameters": { // "additionalProperties": false, // "properties": { // "EnvironmentVariables": { // "additionalProperties": false, // "patternProperties": { // "": { // "type": "string" // } // }, // "type": "object" // }, // "EventSources": { // "insertionOrder": false, // "items": { // "additionalProperties": false, // "properties": { // "Topic": { // "type": "string" // }, // "Type": { // "enum": [ // "PUB_SUB", // "IOT_CORE" // ], // "type": "string" // } // }, // "type": "object" // }, // "type": "array" // }, // "ExecArgs": { // "insertionOrder": true, // "items": { // "type": "string" // }, // "type": "array" // }, // "InputPayloadEncodingType": { // "enum": [ // "json", // "binary" // ], // "type": "string" // }, // "LinuxProcessParams": { // "additionalProperties": false, // "properties": { // "ContainerParams": { // "additionalProperties": false, // "properties": { // "Devices": { // "insertionOrder": false, // "items": { // "additionalProperties": false, // "properties": { // "AddGroupOwner": { // "type": "boolean" // }, // "Path": { // "type": "string" // }, // "Permission": { // "enum": [ // "ro", // "rw" // ], // "type": "string" // } // }, // "type": "object" // }, // "type": "array" // }, // "MemorySizeInKB": { // "type": "integer" // }, // "MountROSysfs": { // "type": "boolean" // }, // "Volumes": { // "insertionOrder": false, // "items": { // "additionalProperties": false, // "properties": { // "AddGroupOwner": { // "type": "boolean" // }, // "DestinationPath": { // "type": "string" // }, // "Permission": { // "enum": [ // "ro", // "rw" // ], // "type": "string" // }, // "SourcePath": { // "type": "string" // } // }, // "type": "object" // }, // "type": "array" // } // }, // "type": "object" // }, // "IsolationMode": { // "enum": [ // "GreengrassContainer", // "NoContainer" // ], // "type": "string" // } // }, // "type": "object" // }, // "MaxIdleTimeInSeconds": { // "type": "integer" // }, // "MaxInstancesCount": { // "type": "integer" // }, // "MaxQueueSize": { // "type": "integer" // }, // "Pinned": { // "type": "boolean" // }, // "StatusTimeoutInSeconds": { // "type": "integer" // }, // "TimeoutInSeconds": { // "type": "integer" // } // }, // "type": "object" // }, // "ComponentName": { // "type": "string" // }, // "ComponentPlatforms": { // "insertionOrder": false, // "items": { // "additionalProperties": false, // "properties": { // "Attributes": { // "additionalProperties": false, // "patternProperties": { // "": { // "type": "string" // } // }, // "type": "object" // }, // "Name": { // "type": "string" // } // }, // "type": "object" // }, // "type": "array" // }, // "ComponentVersion": { // "type": "string" // }, // "LambdaArn": { // "pattern": "^arn:aws(-(cn|us-gov))?:lambda:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } // }, // "type": "object" // } Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "component_dependencies": { // Property: ComponentDependencies // Pattern: "" Attributes: tfsdk.MapNestedAttributes( map[string]tfsdk.Attribute{ "dependency_type": { // Property: DependencyType Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "SOFT", "HARD", }), }, }, "version_requirement": { // Property: VersionRequirement Type: types.StringType, Optional: true, }, }, tfsdk.MapNestedAttributesOptions{}, ), Optional: true, }, "component_lambda_parameters": { // Property: ComponentLambdaParameters Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "environment_variables": { // Property: EnvironmentVariables // Pattern: "" Type: types.MapType{ElemType: types.StringType}, Optional: true, }, "event_sources": { // Property: EventSources Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "topic": { // Property: Topic Type: types.StringType, Optional: true, }, "type": { // Property: Type Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "PUB_SUB", "IOT_CORE", }), }, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, "exec_args": { // Property: ExecArgs Type: types.ListType{ElemType: types.StringType}, Optional: true, }, "input_payload_encoding_type": { // Property: InputPayloadEncodingType Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "json", "binary", }), }, }, "linux_process_params": { // Property: LinuxProcessParams Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "container_params": { // Property: ContainerParams Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "devices": { // Property: Devices Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "add_group_owner": { // Property: AddGroupOwner Type: types.BoolType, Optional: true, }, "path": { // Property: Path Type: types.StringType, Optional: true, }, "permission": { // Property: Permission Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "ro", "rw", }), }, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, "memory_size_in_kb": { // Property: MemorySizeInKB Type: types.Int64Type, Optional: true, }, "mount_ro_sysfs": { // Property: MountROSysfs Type: types.BoolType, Optional: true, }, "volumes": { // Property: Volumes Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "add_group_owner": { // Property: AddGroupOwner Type: types.BoolType, Optional: true, }, "destination_path": { // Property: DestinationPath Type: types.StringType, Optional: true, }, "permission": { // Property: Permission Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "ro", "rw", }), }, }, "source_path": { // Property: SourcePath Type: types.StringType, Optional: true, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, }, ), Optional: true, }, "isolation_mode": { // Property: IsolationMode Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "GreengrassContainer", "NoContainer", }), }, }, }, ), Optional: true, }, "max_idle_time_in_seconds": { // Property: MaxIdleTimeInSeconds Type: types.Int64Type, Optional: true, }, "max_instances_count": { // Property: MaxInstancesCount Type: types.Int64Type, Optional: true, }, "max_queue_size": { // Property: MaxQueueSize Type: types.Int64Type, Optional: true, }, "pinned": { // Property: Pinned Type: types.BoolType, Optional: true, }, "status_timeout_in_seconds": { // Property: StatusTimeoutInSeconds Type: types.Int64Type, Optional: true, }, "timeout_in_seconds": { // Property: TimeoutInSeconds Type: types.Int64Type, Optional: true, }, }, ), Optional: true, }, "component_name": { // Property: ComponentName Type: types.StringType, Optional: true, }, "component_platforms": { // Property: ComponentPlatforms Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "attributes": { // Property: Attributes // Pattern: "" Type: types.MapType{ElemType: types.StringType}, Optional: true, }, "name": { // Property: Name Type: types.StringType, Optional: true, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, "component_version": { // Property: ComponentVersion Type: types.StringType, Optional: true, }, "lambda_arn": { // Property: LambdaArn Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov))?:lambda:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), ""), }, }, }, ), Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, // LambdaFunction is a write-only property. }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "additionalProperties": false, // "patternProperties": { // "": { // "maxLength": 256, // "type": "string" // } // }, // "type": "object" // } // Pattern: "" Type: types.MapType{ElemType: types.StringType}, Optional: true, }, } attributes["id"] = tfsdk.Attribute{ Description: "Uniquely identifies the resource.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, } schema := tfsdk.Schema{ Description: "Resource for Greengrass component version.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::GreengrassV2::ComponentVersion").WithTerraformTypeName("awscc_greengrassv2_component_version") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "add_group_owner": "AddGroupOwner", "arn": "Arn", "attributes": "Attributes", "component_dependencies": "ComponentDependencies", "component_lambda_parameters": "ComponentLambdaParameters", "component_name": "ComponentName", "component_platforms": "ComponentPlatforms", "component_version": "ComponentVersion", "container_params": "ContainerParams", "dependency_type": "DependencyType", "destination_path": "DestinationPath", "devices": "Devices", "environment_variables": "EnvironmentVariables", "event_sources": "EventSources", "exec_args": "ExecArgs", "inline_recipe": "InlineRecipe", "input_payload_encoding_type": "InputPayloadEncodingType", "isolation_mode": "IsolationMode", "lambda_arn": "LambdaArn", "lambda_function": "LambdaFunction", "linux_process_params": "LinuxProcessParams", "max_idle_time_in_seconds": "MaxIdleTimeInSeconds", "max_instances_count": "MaxInstancesCount", "max_queue_size": "MaxQueueSize", "memory_size_in_kb": "MemorySizeInKB", "mount_ro_sysfs": "MountROSysfs", "name": "Name", "path": "Path", "permission": "Permission", "pinned": "Pinned", "source_path": "SourcePath", "status_timeout_in_seconds": "StatusTimeoutInSeconds", "tags": "Tags", "timeout_in_seconds": "TimeoutInSeconds", "topic": "Topic", "type": "Type", "version_requirement": "VersionRequirement", "volumes": "Volumes", }) opts = opts.WithWriteOnlyPropertyPaths([]string{ "/properties/LambdaFunction", "/properties/InlineRecipe", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }