Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements d.IsNewResource() Check in Read functions for OpsWorks Layers and API Gateway (v1) resources #20221

Merged
merged 4 commits into from
Dec 3, 2021

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Jul 16, 2021

Implements d.IsNewResource() Check in Read functions for OpsWorks Layers and API Gateway (v1) resources

Relates #16796

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSAPIGatewayDomainName\|TestAccAWSAPIGatewayIntegration\|TestAccAWSAPIGatewayApiKey\|TestAccAWSAPIGatewayRequestValidator\|TestAccAWSAPIGatewayStage\|TestAccAWSAPIGatewayUsagePlanKey\|TestAccAWSAPIGatewayDocumentationVersion\|TestAccAWSAPIGatewayRestApi\|TestAccAWSAPIGatewayBasePathMapping\|TestAccAWSAPIGatewayIntegrationResponse\|TestAccAWSAPIGatewayMethodResponse\|TestAccAWSAPIGatewayMethodSettings\|TestAccAWSAPIGatewayDeployment\|TestAccAWSAPIGatewayModel\|TestAccAWSAPIGatewayGatewayResponse\|TestAccAWSAPIGatewayMethod\|TestAccAWSAPIGatewayUsagePlan\|TestAccAWSAPIGatewayDocumentationPart\|TestAccAWSAPIGatewayVpcLink\|TestAccAWSAPIGatewayRestApiPolicy\|TestAccAWSAPIGatewayAuthorizer\|TestAccAWSAPIGatewayClientCertificate\|TestAccAWSAPIGatewayResource'

--- PASS: TestDecodeApiGatewayBasePathMappingId (0.00s)
--- PASS: TestAccAWSAPIGatewayApiKey_disappears (43.81s)
--- PASS: TestAccAWSAPIGatewayApiKey_Value (53.24s)
--- PASS: TestAccAWSAPIGatewayApiKey_basic (56.82s)
--- PASS: TestAccAWSAPIGatewayClientCertificate_disappears (51.45s)
--- PASS: TestAccAWSAPIGatewayClientCertificate_basic (97.35s)
--- PASS: TestAccAWSAPIGatewayApiKey_Description (102.59s)
--- PASS: TestAccAWSAPIGatewayApiKey_Enabled (104.70s)
--- PASS: TestAccAWSAPIGatewayDeployment_disappears_RestApi (57.40s)
--- PASS: TestAccAWSAPIGatewayAuthorizer_authTypeValidation (117.02s)
--- PASS: TestAccAWSAPIGatewayClientCertificate_tags (128.68s)
--- PASS: TestAccAWSAPIGatewayApiKey_Tags (132.80s)
--- PASS: TestAccAWSAPIGatewayBasePathMapping_basic (146.27s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageDescription (44.60s)
--- PASS: TestAccAWSAPIGatewayDeployment_Description (81.09s)
--- PASS: TestAccAWSAPIGatewayBasePathMapping_disappears (182.36s)
--- PASS: TestAccAWSAPIGatewayBasePathMapping_BasePath_Empty (205.38s)
--- PASS: TestAccAWSAPIGatewayDeployment_Variables (92.52s)
--- SKIP: TestAccAWSAPIGatewayDomainName_CertificateArn (0.00s)
--- SKIP: TestAccAWSAPIGatewayDomainName_CertificateName (0.00s)
--- PASS: TestAccAWSAPIGatewayDomainName_RegionalCertificateArn (18.55s)
--- SKIP: TestAccAWSAPIGatewayDomainName_RegionalCertificateName (0.00s)
--- PASS: TestAccAWSAPIGatewayDocumentationVersion_disappears (36.26s)
--- PASS: TestAccAWSAPIGatewayBasePathMapping_updates (247.17s)
--- PASS: TestAccAWSAPIGatewayAuthorizer_disappears (274.23s)
--- SKIP: TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication (0.00s)
--- PASS: TestAccAWSAPIGatewayDomainName_SecurityPolicy (76.05s)
--- PASS: TestAccAWSAPIGatewayDocumentationVersion_allFields (122.72s)
--- PASS: TestAccAWSAPIGatewayIntegrationResponse_basic (27.00s)
--- PASS: TestAccAWSAPIGatewayDomainName_Tags (99.84s)
--- PASS: TestAccAWSAPIGatewayDeployment_Triggers (262.92s)
--- PASS: TestAccAWSAPIGatewayDomainName_disappears (123.26s)
--- PASS: TestAccAWSAPIGatewayIntegration_cache_key_parameters (18.36s)
--- PASS: TestAccAWSAPIGatewayDeployment_basic (365.41s)
--- PASS: TestAccAWSAPIGatewayAuthorizer_cognito (459.60s)
--- PASS: TestAccAWSAPIGatewayIntegration_TlsConfig_InsecureSkipVerification (63.87s)
--- PASS: TestAccAWSAPIGatewayMethodResponse_basic (35.53s)
--- PASS: TestAccAWSAPIGatewayMethodResponse_disappears (27.38s)
--- PASS: TestAccAWSAPIGatewayAuthorizer_switchAuthType (578.32s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_basic (57.80s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_CacheDataEncrypted (27.27s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_CachingEnabled (32.60s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_CacheTtlInSeconds (57.65s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_LoggingLevel (32.51s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_MetricsEnabled (39.22s)
--- PASS: TestAccAWSAPIGatewayAuthorizer_basic (745.66s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_Multiple (32.55s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_ThrottlingBurstLimit (38.67s)
--- PASS: TestAccAWSAPIGatewayIntegration_basic (492.92s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_ThrottlingRateLimit (26.04s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_ThrottlingRateLimitDisabledByDefault (28.42s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_UnauthorizedCacheControlHeaderStrategy (30.08s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_disappears (39.25s)
--- PASS: TestAccAWSAPIGatewayAuthorizer_cognito_authorizerCredentials (1012.07s)
--- PASS: TestAccAWSAPIGatewayDocumentationPart_method (881.63s)
--- PASS: TestAccAWSAPIGatewayMethod_cognitoauthorizer (34.62s)
--- PASS: TestAccAWSAPIGatewayDocumentationPart_basic (957.58s)
--- PASS: TestAccAWSAPIGatewayMethod_disappears (23.80s)
--- PASS: TestAccAWSAPIGatewayGatewayResponse_basic (836.96s)
--- PASS: TestAccAWSAPIGatewayMethod_customauthorizer (212.84s)
--- PASS: TestAccAWSAPIGatewayModel_disappears (15.34s)
--- FAIL: TestAccAWSAPIGatewayIntegration_integrationType (866.08s)
--- PASS: TestAccAWSAPIGatewayRequestValidator_disappears (23.57s)
--- PASS: TestAccAWSAPIGatewayRequestValidator_basic (68.02s)
--- PASS: TestAccAWSAPIGatewayResource_update (22.82s)
--- PASS: TestAccAWSAPIGatewayResource_disappears (33.85s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_ThrottlingBurstLimitDisabledByDefault (580.95s)
--- PASS: TestAccAWSAPIGatewayIntegration_disappears (975.57s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_RequireAuthorizationForCacheControl (732.58s)
--- PASS: TestAccAWSAPIGatewayRestApiPolicy_disappears_restApi (55.08s)
--- PASS: TestAccAWSAPIGatewayRestApi_tags (32.87s)
--- PASS: TestAccAWSAPIGatewayGatewayResponse_disappears (1242.78s)
--- PASS: TestAccAWSAPIGatewayRestApiPolicy_basic (227.96s)
--- PASS: TestAccAWSAPIGatewayRestApi_basic (128.75s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_Private (22.30s)
--- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource (34.21s)
--- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource_OverrideBody (86.55s)
--- PASS: TestAccAWSAPIGatewayResource_basic (430.13s)
--- PASS: TestAccAWSAPIGatewayRestApi_disappears (211.55s)
--- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_OverrideBody (54.53s)
--- PASS: TestAccAWSAPIGatewayRestApi_Body (30.53s)
--- PASS: TestAccAWSAPIGatewayAuthorizer_zero_ttl (1808.92s)
--- PASS: TestAccAWSAPIGatewayRestApi_Description_OverrideBody (41.85s)
--- PASS: TestAccAWSAPIGatewayRestApi_Description_SetByBody (19.80s)
--- PASS: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint (34.20s)
--- PASS: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_OverrideBody (33.95s)
--- PASS: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_SetByBody (27.33s)
--- PASS: TestAccAWSAPIGatewayRestApiPolicy_disappears (624.31s)
--- PASS: TestAccAWSAPIGatewayRestApi_Description (237.31s)
--- PASS: TestAccAWSAPIGatewayMethod_basic (1073.10s)
--- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes (343.26s)
--- PASS: TestAccAWSAPIGatewayMethod_OperationName (967.77s)
--- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_SetByBody (20.56s)
--- PASS: TestAccAWSAPIGatewayIntegrationResponse_disappears (1828.73s)
--- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_SetByBody (441.50s)
--- PASS: TestAccAWSAPIGatewayRestApi_Parameters (30.51s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_SetByBody (173.20s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_OverrideBody (206.15s)
--- PASS: TestAccAWSAPIGatewayRestApi_Policy_SetByBody (23.59s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds (263.97s)
--- PASS: TestAccAWSAPIGatewayStage_disappears_ReferencingDeployment (44.02s)
--- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize (241.15s)
--- PASS: TestAccAWSAPIGatewayModel_basic (1226.44s)
--- PASS: TestAccAWSAPIGatewayRestApi_Policy (186.31s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration (815.52s)
--- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource_SetByBody (782.94s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_basic (33.91s)
--- PASS: TestAccAWSAPIGatewayAuthorizer_switchAuthorizerTTL (2497.23s)
--- PASS: TestAccAWSAPIGatewayUsagePlanKey_KeyId_Concurrency (133.32s)
--- PASS: TestAccAWSAPIGatewayStage_accessLogSettings (224.01s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_productCode (58.47s)
--- PASS: TestAccAWSAPIGatewayStage_accessLogSettings_kinesis (334.71s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_quota (51.44s)
--- PASS: TestAccAWSAPIGatewayRestApi_Policy_OverrideBody (479.14s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_apiStages_multiple (25.02s)
--- PASS: TestAccAWSAPIGatewayDocumentationVersion_basic (2552.51s)
--- PASS: TestAccAWSAPIGatewayRestApi_Name_OverrideBody (659.39s)
--- PASS: TestAccAWSAPIGatewayUsagePlanKey_basic (462.14s)
--- PASS: TestAccAWSAPIGatewayStage_basic (605.03s)
--- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_OverrideBody (808.65s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_description (371.38s)
--- PASS: TestAccAWSAPIGatewayIntegration_contentHandling (2558.87s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_throttling (447.07s)
--- PASS: TestAccAWSAPIGatewayDocumentationPart_responseHeader (2846.23s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_apiStages (345.81s)
--- PASS: TestAccAWSAPIGatewayStage_disappears (813.48s)
--- PASS: TestAccAWSAPIGatewayMethod_customrequestvalidator (2038.27s)
--- PASS: TestAccAWSAPIGatewayDocumentationPart_disappears (2958.94s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName_EmptyString (3034.89s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_disappears (497.65s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName (3131.95s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_throttlingInitialRateLimit (776.63s)
--- PASS: TestAccAWSAPIGatewayUsagePlanKey_disappears (1001.26s)
--- PASS: TestAccAWSAPIGatewayMethodSettings_Settings_DataTraceEnabled (2848.82s)
--- FAIL: TestAccAWSAPIGatewayVpcLink_basic (815.56s)
--- FAIL: TestAccAWSAPIGatewayVpcLink_tags (815.13s)
--- FAIL: TestAccAWSAPIGatewayVpcLink_disappears (855.12s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_tags (1292.06s)

The failed tests are addressed by #20316

@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. service/apigateway Issues and PRs that pertain to the apigateway service. service/opsworks Issues and PRs that pertain to the opsworks service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 16, 2021
@gdavison gdavison marked this pull request as ready for review July 26, 2021 19:39
@anGie44 anGie44 self-assigned this Jul 26, 2021
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple comments in the error formatting for a couple of files, otherwise LGTM 👍

aws/resource_aws_api_gateway_documentation_version.go Outdated Show resolved Hide resolved
aws/resource_aws_api_gateway_domain_name.go Outdated Show resolved Hide resolved
aws/resource_aws_api_gateway_gateway_response.go Outdated Show resolved Hide resolved
aws/resource_aws_api_gateway_integration.go Outdated Show resolved Hide resolved
aws/resource_aws_api_gateway_integration_response.go Outdated Show resolved Hide resolved
aws/resource_aws_api_gateway_method.go Outdated Show resolved Hide resolved
aws/resource_aws_api_gateway_method_response.go Outdated Show resolved Hide resolved
aws/resource_aws_api_gateway_model.go Outdated Show resolved Hide resolved
aws/resource_aws_api_gateway_request_validator.go Outdated Show resolved Hide resolved
aws/resource_aws_api_gateway_resource.go Outdated Show resolved Hide resolved
@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

@github-actions github-actions bot added linter Pertains to changes to or issues with the various linters. pre-service-packages Includes pre-Service Packages aspects. and removed service/opsworks Issues and PRs that pertain to the opsworks service. service/apigateway Issues and PRs that pertain to the apigateway service. labels Nov 9, 2021
@github-actions github-actions bot added service/amp Issues and PRs that pertain to the amp service. service/apigateway Issues and PRs that pertain to the apigateway service. service/opsworks Issues and PRs that pertain to the opsworks service. size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. pre-service-packages Includes pre-Service Packages aspects. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 17, 2021
@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Nov 24, 2021
@gdavison gdavison merged commit 6c4b36d into main Dec 3, 2021
@gdavison gdavison deleted the semgrep_isnewresource_check branch December 3, 2021 00:50
@github-actions github-actions bot added this to the v3.69.0 milestone Dec 3, 2021
github-actions bot pushed a commit that referenced this pull request Dec 3, 2021
@github-actions
Copy link

This functionality has been released in v3.69.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linter Pertains to changes to or issues with the various linters. service/amp Issues and PRs that pertain to the amp service. service/apigateway Issues and PRs that pertain to the apigateway service. service/opsworks Issues and PRs that pertain to the opsworks service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants