@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
104 lines • 4.54 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.DelegatedAdministrator = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage an [AWS Organizations Delegated Administrator](https://docs.aws.amazon.com/organizations/latest/APIReference/API_RegisterDelegatedAdministrator.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.organizations.DelegatedAdministrator("example", {
* accountId: "123456789012",
* servicePrincipal: "principal",
* });
* ```
*
* ## Import
*
* ### Identity Schema
*
* #### Required
*
* * `service_principal` (String) Service principal for the AWS service.
*
* * `delegated_account_id` (String) Account ID to be designated as a delegated administrator.
*
* #### Optional
*
* * `account_id` (String) AWS Account where this resource is managed.
*
* Using `pulumi import`, import `aws_organizations_delegated_administrator` using the account ID and its service principal. For example:
*
* % pulumi import aws_organizations_delegated_administrator.example 123456789012/config.amazonaws.com
*/
class DelegatedAdministrator extends pulumi.CustomResource {
/**
* Get an existing DelegatedAdministrator 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 DelegatedAdministrator(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DelegatedAdministrator. 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'] === DelegatedAdministrator.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state?.accountId;
resourceInputs["arn"] = state?.arn;
resourceInputs["delegationEnabledDate"] = state?.delegationEnabledDate;
resourceInputs["email"] = state?.email;
resourceInputs["joinedMethod"] = state?.joinedMethod;
resourceInputs["joinedTimestamp"] = state?.joinedTimestamp;
resourceInputs["name"] = state?.name;
resourceInputs["servicePrincipal"] = state?.servicePrincipal;
resourceInputs["status"] = state?.status;
}
else {
const args = argsOrState;
if (args?.accountId === undefined && !opts.urn) {
throw new Error("Missing required property 'accountId'");
}
if (args?.servicePrincipal === undefined && !opts.urn) {
throw new Error("Missing required property 'servicePrincipal'");
}
resourceInputs["accountId"] = args?.accountId;
resourceInputs["servicePrincipal"] = args?.servicePrincipal;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["delegationEnabledDate"] = undefined /*out*/;
resourceInputs["email"] = undefined /*out*/;
resourceInputs["joinedMethod"] = undefined /*out*/;
resourceInputs["joinedTimestamp"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DelegatedAdministrator.__pulumiType, name, resourceInputs, opts);
}
}
exports.DelegatedAdministrator = DelegatedAdministrator;
/** @internal */
DelegatedAdministrator.__pulumiType = 'aws:organizations/delegatedAdministrator:DelegatedAdministrator';
//# sourceMappingURL=delegatedAdministrator.js.map