db_instance_role_association submodule creates an aws_db_instance_role_association resource, linking an IAM role to an RDS DB instance for a named feature (e.g. S3 integration, Lambda access). The root module uses this submodule via for_each over the db_instance_role_associations map variable.
Source
How the root module uses this submodule
The root module creates one association per entry in thedb_instance_role_associations map:
db_instance_role_associations:
feature_name and the map value becomes the role_arn.
Standalone usage
To use this submodule directly — for example when the DB instance is managed by a separate module:The
feature_name must match the RDS feature name exactly as recognized by the AWS API. Common values include s3Import, s3Export, Lambda, and SageMaker.Input variables
Determines whether to create the DB instance role association resource.Default:
trueThe name of the RDS feature to associate with the IAM role. Common values:
s3Import, s3Export, Lambda, SageMaker.Default: nullThe Amazon Resource Name (ARN) of the IAM role to associate with the DB instance.Default:
nullThe identifier of the DB instance to associate with the IAM role.Default:
nullRegion where the association will be managed. Defaults to the region set in the provider configuration.Default:
nullOutputs
The association ID, formatted as
db_instance_identifier,role_arn. This is the composite identifier used by the AWS provider.