From 2fb21609efa55286a35f0268dfc638aa0163fa38 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 16 Aug 2021 11:00:57 -0400 Subject: [PATCH] Don't generate aws_events_connection. --- internal/aws/events/connection_gen.go | 588 --------------------- internal/aws/events/connection_gen_test.go | 22 - internal/provider/all_schemas.hcl | 7 +- internal/provider/resources.go | 1 - 4 files changed, 4 insertions(+), 614 deletions(-) delete mode 100644 internal/aws/events/connection_gen.go delete mode 100644 internal/aws/events/connection_gen_test.go diff --git a/internal/aws/events/connection_gen.go b/internal/aws/events/connection_gen.go deleted file mode 100644 index 977ab16c4d..0000000000 --- a/internal/aws/events/connection_gen.go +++ /dev/null @@ -1,588 +0,0 @@ -// Code generated by generators/resource/main.go; DO NOT EDIT. - -package events - -import ( - "context" - - hclog "github.com/hashicorp/go-hclog" - "github.com/hashicorp/terraform-plugin-framework/schema" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - tflog "github.com/hashicorp/terraform-plugin-log" - . "github.com/hashicorp/terraform-provider-aws-cloudapi/internal/generic" - "github.com/hashicorp/terraform-provider-aws-cloudapi/internal/registry" -) - -func init() { - registry.AddResourceTypeFactory("aws_events_connection", connectionResourceType) -} - -// connectionResourceType returns the Terraform aws_events_connection resource type. -// This Terraform resource type corresponds to the CloudFormation AWS::Events::Connection resource type. -func connectionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { - attributes := map[string]schema.Attribute{ - "arn": { - // Property: Arn - // CloudFormation resource type schema: - // { - // "description": "The arn of the connection resource.", - // "type": "string" - // } - Description: "The arn of the connection resource.", - Type: types.StringType, - Computed: true, - }, - "auth_parameters": { - // Property: AuthParameters - // CloudFormation resource type schema: - // { - // "additionalProperties": false, - // "properties": { - // "ApiKeyAuthParameters": { - // "additionalProperties": false, - // "properties": { - // "ApiKeyName": { - // "type": "string" - // }, - // "ApiKeyValue": { - // "type": "string" - // } - // }, - // "required": [ - // "ApiKeyName", - // "ApiKeyValue" - // ], - // "type": "object" - // }, - // "BasicAuthParameters": { - // "additionalProperties": false, - // "properties": { - // "Password": { - // "type": "string" - // }, - // "Username": { - // "type": "string" - // } - // }, - // "required": [ - // "Username", - // "Password" - // ], - // "type": "object" - // }, - // "InvocationHttpParameters": { - // "additionalProperties": false, - // "properties": { - // "BodyParameters": { - // "items": { - // "additionalProperties": false, - // "properties": { - // "IsValueSecret": { - // "type": "boolean" - // }, - // "Key": { - // "type": "string" - // }, - // "Value": { - // "type": "string" - // } - // }, - // "required": [ - // "Key", - // "Value" - // ], - // "type": "object" - // }, - // "type": "array" - // }, - // "HeaderParameters": { - // "items": { - // "additionalProperties": false, - // "properties": { - // "IsValueSecret": { - // "type": "boolean" - // }, - // "Key": { - // "type": "string" - // }, - // "Value": { - // "type": "string" - // } - // }, - // "required": [ - // "Key", - // "Value" - // ], - // "type": "object" - // }, - // "type": "array" - // }, - // "QueryStringParameters": { - // "items": { - // "additionalProperties": false, - // "properties": { - // "IsValueSecret": { - // "type": "boolean" - // }, - // "Key": { - // "type": "string" - // }, - // "Value": { - // "type": "string" - // } - // }, - // "required": [ - // "Key", - // "Value" - // ], - // "type": "object" - // }, - // "type": "array" - // } - // }, - // "type": "object" - // }, - // "OAuthParameters": { - // "additionalProperties": false, - // "properties": { - // "AuthorizationEndpoint": { - // "maxLength": 2048, - // "minLength": 1, - // "type": "string" - // }, - // "ClientParameters": { - // "additionalProperties": false, - // "properties": { - // "ClientID": { - // "type": "string" - // }, - // "ClientSecret": { - // "type": "string" - // } - // }, - // "required": [ - // "ClientID", - // "ClientSecret" - // ], - // "type": "object" - // }, - // "HttpMethod": { - // "enum": [ - // "GET", - // "POST", - // "PUT" - // ], - // "type": "string" - // }, - // "OAuthHttpParameters": { - // "additionalProperties": false, - // "properties": { - // "BodyParameters": { - // "items": { - // "additionalProperties": false, - // "properties": { - // "IsValueSecret": { - // "type": "boolean" - // }, - // "Key": { - // "type": "string" - // }, - // "Value": { - // "type": "string" - // } - // }, - // "required": [ - // "Key", - // "Value" - // ], - // "type": "object" - // }, - // "type": "array" - // }, - // "HeaderParameters": { - // "items": { - // "additionalProperties": false, - // "properties": { - // "IsValueSecret": { - // "type": "boolean" - // }, - // "Key": { - // "type": "string" - // }, - // "Value": { - // "type": "string" - // } - // }, - // "required": [ - // "Key", - // "Value" - // ], - // "type": "object" - // }, - // "type": "array" - // }, - // "QueryStringParameters": { - // "items": { - // "additionalProperties": false, - // "properties": { - // "IsValueSecret": { - // "type": "boolean" - // }, - // "Key": { - // "type": "string" - // }, - // "Value": { - // "type": "string" - // } - // }, - // "required": [ - // "Key", - // "Value" - // ], - // "type": "object" - // }, - // "type": "array" - // } - // }, - // "type": "object" - // } - // }, - // "required": [ - // "ClientParameters", - // "AuthorizationEndpoint", - // "HttpMethod" - // ], - // "type": "object" - // } - // }, - // "type": "object" - // } - Attributes: schema.SingleNestedAttributes( - map[string]schema.Attribute{ - "api_key_auth_parameters": { - // Property: ApiKeyAuthParameters - Attributes: schema.SingleNestedAttributes( - map[string]schema.Attribute{ - "api_key_name": { - // Property: ApiKeyName - Type: types.StringType, - Required: true, - }, - "api_key_value": { - // Property: ApiKeyValue - Type: types.StringType, - Required: true, - }, - }, - ), - Optional: true, - }, - "basic_auth_parameters": { - // Property: BasicAuthParameters - Attributes: schema.SingleNestedAttributes( - map[string]schema.Attribute{ - "password": { - // Property: Password - Type: types.StringType, - Required: true, - }, - "username": { - // Property: Username - Type: types.StringType, - Required: true, - }, - }, - ), - Optional: true, - }, - "invocation_http_parameters": { - // Property: InvocationHttpParameters - Attributes: schema.SingleNestedAttributes( - map[string]schema.Attribute{ - "body_parameters": { - // Property: BodyParameters - Attributes: schema.ListNestedAttributes( - map[string]schema.Attribute{ - "is_value_secret": { - // Property: IsValueSecret - Type: types.BoolType, - Optional: true, - }, - "key": { - // Property: Key - Type: types.StringType, - Required: true, - }, - "value": { - // Property: Value - Type: types.StringType, - Required: true, - }, - }, - schema.ListNestedAttributesOptions{}, - ), - Optional: true, - }, - "header_parameters": { - // Property: HeaderParameters - Attributes: schema.ListNestedAttributes( - map[string]schema.Attribute{ - "is_value_secret": { - // Property: IsValueSecret - Type: types.BoolType, - Optional: true, - }, - "key": { - // Property: Key - Type: types.StringType, - Required: true, - }, - "value": { - // Property: Value - Type: types.StringType, - Required: true, - }, - }, - schema.ListNestedAttributesOptions{}, - ), - Optional: true, - }, - "query_string_parameters": { - // Property: QueryStringParameters - Attributes: schema.ListNestedAttributes( - map[string]schema.Attribute{ - "is_value_secret": { - // Property: IsValueSecret - Type: types.BoolType, - Optional: true, - }, - "key": { - // Property: Key - Type: types.StringType, - Required: true, - }, - "value": { - // Property: Value - Type: types.StringType, - Required: true, - }, - }, - schema.ListNestedAttributesOptions{}, - ), - Optional: true, - }, - }, - ), - Optional: true, - }, - "o_auth_parameters": { - // Property: OAuthParameters - Attributes: schema.SingleNestedAttributes( - map[string]schema.Attribute{ - "authorization_endpoint": { - // Property: AuthorizationEndpoint - Type: types.StringType, - Required: true, - }, - "client_parameters": { - // Property: ClientParameters - Attributes: schema.SingleNestedAttributes( - map[string]schema.Attribute{ - "client_id": { - // Property: ClientID - Type: types.StringType, - Required: true, - }, - "client_secret": { - // Property: ClientSecret - Type: types.StringType, - Required: true, - }, - }, - ), - Required: true, - }, - "http_method": { - // Property: HttpMethod - Type: types.StringType, - Required: true, - }, - "o_auth_http_parameters": { - // Property: OAuthHttpParameters - Attributes: schema.SingleNestedAttributes( - map[string]schema.Attribute{ - "body_parameters": { - // Property: BodyParameters - Attributes: schema.ListNestedAttributes( - map[string]schema.Attribute{ - "is_value_secret": { - // Property: IsValueSecret - Type: types.BoolType, - Optional: true, - }, - "key": { - // Property: Key - Type: types.StringType, - Required: true, - }, - "value": { - // Property: Value - Type: types.StringType, - Required: true, - }, - }, - schema.ListNestedAttributesOptions{}, - ), - Optional: true, - }, - "header_parameters": { - // Property: HeaderParameters - Attributes: schema.ListNestedAttributes( - map[string]schema.Attribute{ - "is_value_secret": { - // Property: IsValueSecret - Type: types.BoolType, - Optional: true, - }, - "key": { - // Property: Key - Type: types.StringType, - Required: true, - }, - "value": { - // Property: Value - Type: types.StringType, - Required: true, - }, - }, - schema.ListNestedAttributesOptions{}, - ), - Optional: true, - }, - "query_string_parameters": { - // Property: QueryStringParameters - Attributes: schema.ListNestedAttributes( - map[string]schema.Attribute{ - "is_value_secret": { - // Property: IsValueSecret - Type: types.BoolType, - Optional: true, - }, - "key": { - // Property: Key - Type: types.StringType, - Required: true, - }, - "value": { - // Property: Value - Type: types.StringType, - Required: true, - }, - }, - schema.ListNestedAttributesOptions{}, - ), - Optional: true, - }, - }, - ), - Optional: true, - }, - }, - ), - Optional: true, - }, - }, - ), - Required: true, - }, - "authorization_type": { - // Property: AuthorizationType - // CloudFormation resource type schema: - // { - // "enum": [ - // "API_KEY", - // "BASIC", - // "OAUTH_CLIENT_CREDENTIALS" - // ], - // "type": "string" - // } - Type: types.StringType, - Required: true, - }, - "description": { - // Property: Description - // CloudFormation resource type schema: - // { - // "description": "Description of the connection.", - // "maxLength": 512, - // "type": "string" - // } - Description: "Description of the connection.", - Type: types.StringType, - Optional: true, - }, - "name": { - // Property: Name - // CloudFormation resource type schema: - // { - // "description": "Name of the connection.", - // "maxLength": 64, - // "minLength": 1, - // "type": "string" - // } - Description: "Name of the connection.", - Type: types.StringType, - Optional: true, - Computed: true, - // Name is a force-new attribute. - }, - "secret_arn": { - // Property: SecretArn - // CloudFormation resource type schema: - // { - // "description": "The arn of the secrets manager secret created in the customer account.", - // "type": "string" - // } - Description: "The arn of the secrets manager secret created in the customer account.", - Type: types.StringType, - Computed: true, - }, - } - - // Required for acceptance testing. - attributes["id"] = schema.Attribute{ - Description: "Uniquely identifies the resource.", - Type: types.StringType, - Computed: true, - } - - schema := schema.Schema{ - Description: "Resource Type definition for AWS::Events::Connection.", - Version: 1, - Attributes: attributes, - } - - var opts ResourceTypeOptions - - opts = opts.WithCloudFormationTypeName("AWS::Events::Connection").WithTerraformTypeName("aws_events_connection").WithTerraformSchema(schema) - - opts = opts.WithWriteOnlyPropertyPaths([]string{ - "/definitions/BasicAuthParameters/Password", - "/definitions/ApiKeyAuthParameters/ApiKeyValue", - "/definitions/OAuthParameters/ClientParameters/ClientSecret", - }) - opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) - - opts = opts.WithUpdateTimeoutInMinutes(0) - - resourceType, err := NewResourceType(ctx, opts...) - - if err != nil { - return nil, err - } - - tflog.Debug(ctx, "Generated schema", "tfTypeName", "aws_events_connection", "schema", hclog.Fmt("%v", schema)) - - return resourceType, nil -} diff --git a/internal/aws/events/connection_gen_test.go b/internal/aws/events/connection_gen_test.go deleted file mode 100644 index c70c58c2ad..0000000000 --- a/internal/aws/events/connection_gen_test.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by generators/resource/main.go; DO NOT EDIT. - -package events_test - -import ( - "regexp" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-provider-aws-cloudapi/internal/acctest" -) - -func TestAccAWSEventsConnection_basic(t *testing.T) { - td := acctest.NewTestData(t, "AWS::Events::Connection", "aws_events_connection", "test") - - td.ResourceTest(t, []resource.TestStep{ - { - Config: td.EmptyConfig(), - ExpectError: regexp.MustCompile("Missing required argument"), - }, - }) -} diff --git a/internal/provider/all_schemas.hcl b/internal/provider/all_schemas.hcl index e69ac3afdd..c78fa83039 100644 --- a/internal/provider/all_schemas.hcl +++ b/internal/provider/all_schemas.hcl @@ -523,9 +523,10 @@ resource_schema "aws_events_archive" { cloudformation_type_name = "AWS::Events::Archive" } -resource_schema "aws_events_connection" { - cloudformation_type_name = "AWS::Events::Connection" -} +# error creating write-only attribute path (/definitions/BasicAuthParameters/Password): expected "properties" for the second property path segment, got: "definitions" +# resource_schema "aws_events_connection" { +# cloudformation_type_name = "AWS::Events::Connection" +# } resource_schema "aws_fis_experiment_template" { cloudformation_type_name = "AWS::FIS::ExperimentTemplate" diff --git a/internal/provider/resources.go b/internal/provider/resources.go index a47c658527..2a7e27e3c0 100644 --- a/internal/provider/resources.go +++ b/internal/provider/resources.go @@ -124,7 +124,6 @@ //go:generate go run generators/resource/main.go -resource aws_eventschemas_registry_policy -cfschema ../service/cloudformation/schemas/AWS_EventSchemas_RegistryPolicy.json -package eventschemas -- ../aws/eventschemas/registry_policy_gen.go ../aws/eventschemas/registry_policy_gen_test.go //go:generate go run generators/resource/main.go -resource aws_events_api_destination -cfschema ../service/cloudformation/schemas/AWS_Events_ApiDestination.json -package events -- ../aws/events/api_destination_gen.go ../aws/events/api_destination_gen_test.go //go:generate go run generators/resource/main.go -resource aws_events_archive -cfschema ../service/cloudformation/schemas/AWS_Events_Archive.json -package events -- ../aws/events/archive_gen.go ../aws/events/archive_gen_test.go -//go:generate go run generators/resource/main.go -resource aws_events_connection -cfschema ../service/cloudformation/schemas/AWS_Events_Connection.json -package events -- ../aws/events/connection_gen.go ../aws/events/connection_gen_test.go //go:generate go run generators/resource/main.go -resource aws_fis_experiment_template -cfschema ../service/cloudformation/schemas/AWS_FIS_ExperimentTemplate.json -package fis -- ../aws/fis/experiment_template_gen.go ../aws/fis/experiment_template_gen_test.go //go:generate go run generators/resource/main.go -resource aws_fms_notification_channel -cfschema ../service/cloudformation/schemas/AWS_FMS_NotificationChannel.json -package fms -- ../aws/fms/notification_channel_gen.go ../aws/fms/notification_channel_gen_test.go //go:generate go run generators/resource/main.go -resource aws_fms_policy -cfschema ../service/cloudformation/schemas/AWS_FMS_Policy.json -package fms -- ../aws/fms/policy_gen.go ../aws/fms/policy_gen_test.go