// Code generated by generators/resource/main.go; DO NOT EDIT. package batch 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_batch_scheduling_policy", schedulingPolicyResourceType) } // schedulingPolicyResourceType returns the Terraform awscc_batch_scheduling_policy resource type. // This Terraform resource type corresponds to the CloudFormation AWS::Batch::SchedulingPolicy resource type. func schedulingPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "arn": { // Property: Arn // CloudFormation resource type schema: // { // "description": "ARN of the Scheduling Policy.", // "type": "string" // } Description: "ARN of the Scheduling Policy.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "fairshare_policy": { // Property: FairsharePolicy // CloudFormation resource type schema: // { // "additionalProperties": false, // "description": "Fair Share Policy for the Job Queue.", // "properties": { // "ComputeReservation": { // "maximum": 99, // "minimum": 0, // "type": "number" // }, // "ShareDecaySeconds": { // "maximum": 604800, // "minimum": 0, // "type": "number" // }, // "ShareDistribution": { // "description": "List of Share Attributes", // "insertionOrder": false, // "items": { // "additionalProperties": false, // "properties": { // "ShareIdentifier": { // "type": "string" // }, // "WeightFactor": { // "maximum": 1000, // "minimum": 0, // "type": "number" // } // }, // "type": "object" // }, // "type": "array" // } // }, // "type": "object" // } Description: "Fair Share Policy for the Job Queue.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "compute_reservation": { // Property: ComputeReservation Type: types.Float64Type, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.FloatBetween(0.000000, 99.000000), }, }, "share_decay_seconds": { // Property: ShareDecaySeconds Type: types.Float64Type, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.FloatBetween(0.000000, 604800.000000), }, }, "share_distribution": { // Property: ShareDistribution Description: "List of Share Attributes", Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "share_identifier": { // Property: ShareIdentifier Type: types.StringType, Optional: true, }, "weight_factor": { // Property: WeightFactor Type: types.Float64Type, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.FloatBetween(0.000000, 1000.000000), }, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, }, ), Optional: true, }, "name": { // Property: Name // CloudFormation resource type schema: // { // "description": "Name of Scheduling Policy.", // "pattern": "", // "type": "string" // } Description: "Name of Scheduling Policy.", Type: types.StringType, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "additionalProperties": false, // "description": "A key-value pair to associate with a resource.", // "patternProperties": { // "": { // "type": "string" // } // }, // "type": "object" // } Description: "A key-value pair to associate with a resource.", // Pattern: "" Type: types.MapType{ElemType: types.StringType}, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, } attributes["id"] = tfsdk.Attribute{ Description: "Uniquely identifies the resource.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, } schema := tfsdk.Schema{ Description: "Resource Type schema for AWS::Batch::SchedulingPolicy", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::Batch::SchedulingPolicy").WithTerraformTypeName("awscc_batch_scheduling_policy") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "arn": "Arn", "compute_reservation": "ComputeReservation", "fairshare_policy": "FairsharePolicy", "name": "Name", "share_decay_seconds": "ShareDecaySeconds", "share_distribution": "ShareDistribution", "share_identifier": "ShareIdentifier", "tags": "Tags", "weight_factor": "WeightFactor", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }