@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
80 lines • 3.84 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoleAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an RDS DB Instance association with an IAM Role. Example use cases:
*
* * [Amazon RDS Oracle integration with Amazon S3](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.html)
* * [Importing Amazon S3 Data into an RDS PostgreSQL DB Instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PostgreSQL.S3Import.html)
*
* > To manage the RDS DB Instance IAM Role for [Enhanced Monitoring](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html), see the `aws.rds.Instance` resource `monitoringRoleArn` argument instead.
*
* ## Import
*
* Using `pulumi import`, import `aws_db_instance_role_association` using the DB Instance Identifier and IAM Role ARN separated by a comma (`,`). For example:
*
* ```sh
* $ pulumi import aws:rds/roleAssociation:RoleAssociation example my-db-instance,arn:aws:iam::123456789012:role/my-role
* ```
*/
class RoleAssociation extends pulumi.CustomResource {
/**
* Get an existing RoleAssociation resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new RoleAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of RoleAssociation. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === RoleAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["dbInstanceIdentifier"] = state?.dbInstanceIdentifier;
resourceInputs["featureName"] = state?.featureName;
resourceInputs["region"] = state?.region;
resourceInputs["roleArn"] = state?.roleArn;
}
else {
const args = argsOrState;
if (args?.dbInstanceIdentifier === undefined && !opts.urn) {
throw new Error("Missing required property 'dbInstanceIdentifier'");
}
if (args?.featureName === undefined && !opts.urn) {
throw new Error("Missing required property 'featureName'");
}
if (args?.roleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'roleArn'");
}
resourceInputs["dbInstanceIdentifier"] = args?.dbInstanceIdentifier;
resourceInputs["featureName"] = args?.featureName;
resourceInputs["region"] = args?.region;
resourceInputs["roleArn"] = args?.roleArn;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RoleAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.RoleAssociation = RoleAssociation;
/** @internal */
RoleAssociation.__pulumiType = 'aws:rds/roleAssociation:RoleAssociation';
//# sourceMappingURL=roleAssociation.js.map