// Code generated by generators/resource/main.go; DO NOT EDIT. package iotsitewise 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_iotsitewise_gateway", gatewayResourceType) } // gatewayResourceType returns the Terraform awscc_iotsitewise_gateway resource type. // This Terraform resource type corresponds to the CloudFormation AWS::IoTSiteWise::Gateway resource type. func gatewayResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "gateway_capability_summaries": { // Property: GatewayCapabilitySummaries // CloudFormation resource type schema: // { // "description": "A list of gateway capability summaries that each contain a namespace and status.", // "insertionOrder": true, // "items": { // "additionalProperties": false, // "description": "Contains a summary of a gateway capability configuration.", // "properties": { // "CapabilityConfiguration": { // "description": "The JSON document that defines the gateway capability's configuration.", // "type": "string" // }, // "CapabilityNamespace": { // "description": "The namespace of the capability configuration.", // "type": "string" // } // }, // "required": [ // "CapabilityNamespace" // ], // "type": "object" // }, // "type": "array", // "uniqueItems": true // } Description: "A list of gateway capability summaries that each contain a namespace and status.", Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "capability_configuration": { // Property: CapabilityConfiguration Description: "The JSON document that defines the gateway capability's configuration.", Type: types.StringType, Optional: true, }, "capability_namespace": { // Property: CapabilityNamespace Description: "The namespace of the capability configuration.", Type: types.StringType, Required: true, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, Validators: []tfsdk.AttributeValidator{ validate.UniqueItems(), }, }, "gateway_id": { // Property: GatewayId // CloudFormation resource type schema: // { // "description": "The ID of the gateway device.", // "type": "string" // } Description: "The ID of the gateway device.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "gateway_name": { // Property: GatewayName // CloudFormation resource type schema: // { // "description": "A unique, friendly name for the gateway.", // "type": "string" // } Description: "A unique, friendly name for the gateway.", Type: types.StringType, Required: true, }, "gateway_platform": { // Property: GatewayPlatform // CloudFormation resource type schema: // { // "additionalProperties": false, // "description": "The gateway's platform. You can only specify one platform in a gateway.", // "oneOf": [ // { // "required": [ // "Greengrass" // ] // }, // { // "required": [ // "GreengrassV2" // ] // } // ], // "properties": { // "Greengrass": { // "additionalProperties": false, // "description": "A gateway that runs on AWS IoT Greengrass V1.", // "properties": { // "GroupArn": { // "description": "The ARN of the Greengrass group.", // "type": "string" // } // }, // "required": [ // "GroupArn" // ], // "type": "object" // }, // "GreengrassV2": { // "additionalProperties": false, // "description": "A gateway that runs on AWS IoT Greengrass V2.", // "properties": { // "CoreDeviceThingName": { // "description": "The name of the CoreDevice in GreenGrass V2.", // "type": "string" // } // }, // "required": [ // "CoreDeviceThingName" // ], // "type": "object" // } // }, // "type": "object" // } Description: "The gateway's platform. You can only specify one platform in a gateway.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "greengrass": { // Property: Greengrass Description: "A gateway that runs on AWS IoT Greengrass V1.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "group_arn": { // Property: GroupArn Description: "The ARN of the Greengrass group.", Type: types.StringType, Required: true, }, }, ), Optional: true, }, "greengrass_v2": { // Property: GreengrassV2 Description: "A gateway that runs on AWS IoT Greengrass V2.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "core_device_thing_name": { // Property: CoreDeviceThingName Description: "The name of the CoreDevice in GreenGrass V2.", Type: types.StringType, Required: true, }, }, ), Optional: true, }, }, ), Required: true, Validators: []tfsdk.AttributeValidator{ validate.RequiredAttributes( validate.OneOfRequired( validate.Required( "greengrass", ), validate.Required( "greengrass_v2", ), ), ), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "description": "A list of key-value pairs that contain metadata for the gateway.", // "insertionOrder": false, // "items": { // "additionalProperties": false, // "description": "To add or update tag, provide both key and value. To delete tag, provide only tag key to be deleted", // "properties": { // "Key": { // "type": "string" // }, // "Value": { // "type": "string" // } // }, // "required": [ // "Key", // "Value" // ], // "type": "object" // }, // "type": "array", // "uniqueItems": false // } Description: "A list of key-value pairs that contain metadata for the gateway.", 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, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, } attributes["id"] = tfsdk.Attribute{ Description: "Uniquely identifies the resource.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, } schema := tfsdk.Schema{ Description: "Resource schema for AWS::IoTSiteWise::Gateway", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::IoTSiteWise::Gateway").WithTerraformTypeName("awscc_iotsitewise_gateway") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "capability_configuration": "CapabilityConfiguration", "capability_namespace": "CapabilityNamespace", "core_device_thing_name": "CoreDeviceThingName", "gateway_capability_summaries": "GatewayCapabilitySummaries", "gateway_id": "GatewayId", "gateway_name": "GatewayName", "gateway_platform": "GatewayPlatform", "greengrass": "Greengrass", "greengrass_v2": "GreengrassV2", "group_arn": "GroupArn", "key": "Key", "tags": "Tags", "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 }