Add Linter to Avoid Cross Resource Function References #16145
Labels
linter
Pertains to changes to or issues with the various linters.
provider
Pertains to the provider itself, rather than any interaction with AWS.
service/ec2
Issues and PRs that pertain to the ec2 service.
stale
Old or inactive issues managed by automation, if no further action taken these will get closed.
technical-debt
Addresses areas of the codebase that need refactoring or redesign.
Community Note
Description
Similar to how we prefer each resource to self-contain its schema, each resource should have self-contained
Create
,Read
,Update
, andDelete
functions. This is to prevent regressions and other unexpected bugs introduced by cross-referencing these functions. For example, theaws_default_route_table
currently has the following cross-references:Create
->resourceAwsDefaultRouteTableCreate
->resourceAwsRouteTableUpdate
(see also awsproviderlint: New Check: Avoid resource.*Update$ calls #12998)Read
->resourceAwsDefaultRouteTableRead
->resourceAwsRouteTableRead
Update
->resourceAwsRouteTableUpdate
Introducing new attributes in the
aws_route_table
resource can breakaws_default_route_table
resource functionality and the potential code duplication is preferred in these cases.Affected Resource(s)
References
The text was updated successfully, but these errors were encountered: