-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Big Changes: AWS Provider Refactor #20000
Comments
This functionality has been released in v3.64.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! |
…ment (#20857) * tests/resource/aws_appsync_graphql_api: Update deprecated Providers to ProviderFactories * resource/aws_appsync_graphql_api: Add `lambda_authorizer_config` argument (#20644) Issue: #20644 API docs: https://docs.aws.amazon.com/appsync/latest/APIReference/API_LambdaAuthorizerConfig.html Output from acceptance testing: ``` make testacc TESTARGS='-run=TestAccAWSAppsyncGraphqlApi_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAppsyncGraphqlApi_ -timeout 180m --- PASS: TestAccAWSAppsyncGraphqlApi_basic (147.72s) --- PASS: TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_AWSIAM (148.24s) --- PASS: TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_APIKey (149.20s) --- PASS: TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_OpenIDConnect (149.32s) --- PASS: TestAccAWSAppsyncGraphqlApi_LogConfig (153.51s) --- PASS: TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_CognitoUserPools (173.33s) --- PASS: TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_AwsLambda (196.04s) --- PASS: TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_Multiple (204.38s) --- PASS: TestAccAWSAppsyncGraphqlApi_XrayEnabled (214.18s) --- PASS: TestAccAWSAppsyncGraphqlApi_Name (215.34s) --- PASS: TestAccAWSAppsyncGraphqlApi_AuthenticationType_AwsLambda (221.80s) --- PASS: TestAccAWSAppsyncGraphqlApi_OpenIDConnectConfig_AuthTTL (235.05s) --- PASS: TestAccAWSAppsyncGraphqlApi_Tags (236.82s) --- PASS: TestAccAWSAppsyncGraphqlApi_UserPoolConfig_AwsRegion (242.45s) --- PASS: TestAccAWSAppsyncGraphqlApi_LogConfig_ExcludeVerboseContent (250.77s) --- PASS: TestAccAWSAppsyncGraphqlApi_UserPoolConfig_DefaultAction (250.94s) --- PASS: TestAccAWSAppsyncGraphqlApi_AuthenticationType_APIKey (116.05s) --- PASS: TestAccAWSAppsyncGraphqlApi_AuthenticationType_OpenIDConnect (115.22s) --- PASS: TestAccAWSAppsyncGraphqlApi_AuthenticationType_AmazonCognitoUserPools (125.39s) --- PASS: TestAccAWSAppsyncGraphqlApi_disappears (65.90s) --- PASS: TestAccAWSAppsyncGraphqlApi_LambdaAuthorizerConfig_IdentityValidationExpression (281.96s) --- PASS: TestAccAWSAppsyncGraphqlApi_AuthenticationType_AWSIAM (88.56s) --- PASS: TestAccAWSAppsyncGraphqlApi_LambdaAuthorizerConfig_AuthorizerUri (294.85s) --- PASS: TestAccAWSAppsyncGraphqlApi_OpenIDConnectConfig_IatTTL (158.58s) --- PASS: TestAccAWSAppsyncGraphqlApi_OpenIDConnectConfig_Issuer (154.12s) --- PASS: TestAccAWSAppsyncGraphqlApi_LogConfig_FieldLogLevel (312.61s) --- PASS: TestAccAWSAppsyncGraphqlApi_Schema (143.80s) --- PASS: TestAccAWSAppsyncGraphqlApi_AuthenticationType (126.84s) --- PASS: TestAccAWSAppsyncGraphqlApi_OpenIDConnectConfig_ClientID (113.13s) --- PASS: TestAccAWSAppsyncGraphqlApi_LambdaAuthorizerConfig_AuthorizerResultTtlInSeconds (356.98s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 359.589s ``` * resource/aws_appsync_graphql_api: Add changelog entry 20857.txt * resource/aws_appsync_graphql_api: Terraform fmt in test config * Revert "tests/resource/aws_appsync_graphql_api: Update deprecated Providers to ProviderFactories" This reverts commit 1f981fc. * tests/resource/aws_appsync_graphql_api: Changes from #20000 and #21400 * graphql_api: Re-order map alphabetically (review comment)
… into f-lightsail-container-service while resolving the conflicts introduced by the refactor in hashicorp#20000
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Relates #21306
Relates #20959
Relates #20431
Relates #19661
Relates #19347
Relates #17893
Relates #17849
Relates #12840
Description
Maintainers and community contributors face an unnecessary layer of difficulty maintaining the code base such as nonresponsive IDEs and the inability to see all project files on GitHub. To address these growing pains, we are planning significant code refactoring of the Terraform AWS Provider. The refactoring will position the provider for better maintainability now and into the future as AWS ever expands its offerings.
What's New
These are highlights of some of the changes.
1. Broken PRs
As with any significant refactor, prior-PRs will be broken. We apologize for the inconvenience and will help you as much as we can to fix them. However, we hope that the benefits of refactoring will far outweigh the inconvenience now.
Examples of changes PRs need:
#21303
Guide to Fixing PRs After Service Packages
2. Where did everything go?
Before, all code lived in the
aws
directory. Now, you'll find most code under theinternal
directory. Here's an example of where files have gone:Before:
After:
3. Naming
The names of everything from variables to functions to files are being simplified and cleaned up:
instance.go
is the instance resource file). Data source do include "data_source" at the end of the file name (e.g.,regions_data_source.go
).SSM
) to every variable, function, and resource in the service. The one exception is acceptance test names (looking through a list of 6000 tests, it is still handy to see the service).Here are examples of some name changes:
aws/resource_aws_ssm_patch_group.go
internal/service/ssm/patch_group.go
aws/data_source_aws_msk_cluster.go
internal/service/kafka/cluster_data_source.go
resourceAwsMqBroker()
ResourceBroker()
dataSourceAwsLambdaFunction()
DataSourceFunction()
resourceAwsDynamoDbGlobalTableStateRefreshFunc()
resourceGlobalTableStateRefreshFunc()
waiter
Functionwaiter.AccountAssignmentCreated()
waitAccountAssignmentCreated()
TestAccDataSourceAWSSignerSigningJob_basic
TestAccSignerSigningJobDataSource_basic
TestAccAWSAcmCertificate_tags
TestAccACMCertificate_tags
4.
acctest
PackageWhen writing acceptance tests, many functions you'll use are now in the
acctest
package. (What was previously calledacctest
,"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
, is now aliased tosdkacctest
.)5. Test Packages
Acceptance tests must be in the
{service}_test
package. For example,TestAccEC2FlowLog_vpcID
would be in theec2_test
package. Some unit tests are not in the{service}_test
package. To clarify, any test file that importsacctest
must be in{service}_test
to avoid an import cycle.One implication of this is that acceptance tests must import their corresponding non-test packages to use its functions or constants. Also, those functions and constants must be exported (i.e., capitalized).
For example, if a test file in
internal/service/ec2_test
uses a function calledsuperDuper()
defined ininternal/service/ec2
:"github.com/terraform-providers/terraform-provider-aws/internal/service/ec2"
, aliased astfec2
,superDuper()
must be exported asSuperDuper()
, andSuperDuper()
using the import alias, i.e.,tfec2.SuperDuper()
.6. Running Tests
Tests run a little differently. For example, to run an IAM test:
% TF_ACC=1 go test ./internal/service/iam -v -count 1 -parallel 20 -run='TestAccIAMRole_basic' -timeout=180m
7. Running Sweepers
Running sweepers requires the
sweep
build tag:% go test ./internal/sweep -v -tags=sweep -sweep="us-west-2" -sweep-allow-failures -timeout=1h
New or Affected Resource(s)
Potential Terraform Configuration
From a practitioner perspective, the AWS Provider should work the same.
References
The text was updated successfully, but these errors were encountered: