// Code generated by generators/singular-data-source/main.go; DO NOT EDIT. package logs 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" ) func init() { registry.AddDataSourceTypeFactory("awscc_logs_query_definition", queryDefinitionDataSourceType) } // queryDefinitionDataSourceType returns the Terraform awscc_logs_query_definition data source type. // This Terraform data source type corresponds to the CloudFormation AWS::Logs::QueryDefinition resource type. func queryDefinitionDataSourceType(ctx context.Context) (tfsdk.DataSourceType, error) { attributes := map[string]tfsdk.Attribute{ "log_group_names": { // Property: LogGroupNames // CloudFormation resource type schema: // { // "description": "Optionally define specific log groups as part of your query definition", // "insertionOrder": false, // "items": { // "description": "LogGroup name", // "maxLength": 512, // "minLength": 1, // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "type": "array" // } Description: "Optionally define specific log groups as part of your query definition", Type: types.ListType{ElemType: types.StringType}, Computed: true, }, "name": { // Property: Name // CloudFormation resource type schema: // { // "description": "A name for the saved query definition", // "maxLength": 255, // "minLength": 1, // "pattern": "^([^:*\\/]+\\/?)*[^:*\\/]+$", // "type": "string" // } Description: "A name for the saved query definition", Type: types.StringType, Computed: true, }, "query_definition_id": { // Property: QueryDefinitionId // CloudFormation resource type schema: // { // "description": "Unique identifier of a query definition", // "maxLength": 256, // "minLength": 0, // "type": "string" // } Description: "Unique identifier of a query definition", Type: types.StringType, Computed: true, }, "query_string": { // Property: QueryString // CloudFormation resource type schema: // { // "description": "The query string to use for this definition", // "maxLength": 10000, // "minLength": 1, // "type": "string" // } Description: "The query string to use for this definition", Type: types.StringType, Computed: true, }, } attributes["id"] = tfsdk.Attribute{ Description: "Uniquely identifies the resource.", Type: types.StringType, Required: true, } schema := tfsdk.Schema{ Description: "Data Source schema for AWS::Logs::QueryDefinition", Version: 1, Attributes: attributes, } var opts DataSourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::Logs::QueryDefinition").WithTerraformTypeName("awscc_logs_query_definition") opts = opts.WithTerraformSchema(schema) opts = opts.WithAttributeNameMap(map[string]string{ "log_group_names": "LogGroupNames", "name": "Name", "query_definition_id": "QueryDefinitionId", "query_string": "QueryString", }) singularDataSourceType, err := NewSingularDataSourceType(ctx, opts...) if err != nil { return nil, err } return singularDataSourceType, nil }