@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
122 lines • 5.87 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.PrimaryContact = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages the specified primary contact information associated with an AWS Account.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.account.PrimaryContact("test", {
* addressLine1: "123 Any Street",
* city: "Seattle",
* companyName: "Example Corp, Inc.",
* countryCode: "US",
* districtOrCounty: "King",
* fullName: "My Name",
* phoneNumber: "+64211111111",
* postalCode: "98101",
* stateOrRegion: "WA",
* websiteUrl: "https://www.examplecorp.com",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import the Primary Contact using the `account_id`. For example:
*
* ```sh
* $ pulumi import aws:account/primaryContact:PrimaryContact test 1234567890
* ```
*/
class PrimaryContact extends pulumi.CustomResource {
/**
* Get an existing PrimaryContact 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 PrimaryContact(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of PrimaryContact. 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'] === PrimaryContact.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state ? state.accountId : undefined;
resourceInputs["addressLine1"] = state ? state.addressLine1 : undefined;
resourceInputs["addressLine2"] = state ? state.addressLine2 : undefined;
resourceInputs["addressLine3"] = state ? state.addressLine3 : undefined;
resourceInputs["city"] = state ? state.city : undefined;
resourceInputs["companyName"] = state ? state.companyName : undefined;
resourceInputs["countryCode"] = state ? state.countryCode : undefined;
resourceInputs["districtOrCounty"] = state ? state.districtOrCounty : undefined;
resourceInputs["fullName"] = state ? state.fullName : undefined;
resourceInputs["phoneNumber"] = state ? state.phoneNumber : undefined;
resourceInputs["postalCode"] = state ? state.postalCode : undefined;
resourceInputs["stateOrRegion"] = state ? state.stateOrRegion : undefined;
resourceInputs["websiteUrl"] = state ? state.websiteUrl : undefined;
}
else {
const args = argsOrState;
if ((!args || args.addressLine1 === undefined) && !opts.urn) {
throw new Error("Missing required property 'addressLine1'");
}
if ((!args || args.city === undefined) && !opts.urn) {
throw new Error("Missing required property 'city'");
}
if ((!args || args.countryCode === undefined) && !opts.urn) {
throw new Error("Missing required property 'countryCode'");
}
if ((!args || args.fullName === undefined) && !opts.urn) {
throw new Error("Missing required property 'fullName'");
}
if ((!args || args.phoneNumber === undefined) && !opts.urn) {
throw new Error("Missing required property 'phoneNumber'");
}
if ((!args || args.postalCode === undefined) && !opts.urn) {
throw new Error("Missing required property 'postalCode'");
}
resourceInputs["accountId"] = args ? args.accountId : undefined;
resourceInputs["addressLine1"] = args ? args.addressLine1 : undefined;
resourceInputs["addressLine2"] = args ? args.addressLine2 : undefined;
resourceInputs["addressLine3"] = args ? args.addressLine3 : undefined;
resourceInputs["city"] = args ? args.city : undefined;
resourceInputs["companyName"] = args ? args.companyName : undefined;
resourceInputs["countryCode"] = args ? args.countryCode : undefined;
resourceInputs["districtOrCounty"] = args ? args.districtOrCounty : undefined;
resourceInputs["fullName"] = args ? args.fullName : undefined;
resourceInputs["phoneNumber"] = args ? args.phoneNumber : undefined;
resourceInputs["postalCode"] = args ? args.postalCode : undefined;
resourceInputs["stateOrRegion"] = args ? args.stateOrRegion : undefined;
resourceInputs["websiteUrl"] = args ? args.websiteUrl : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PrimaryContact.__pulumiType, name, resourceInputs, opts);
}
}
exports.PrimaryContact = PrimaryContact;
/** @internal */
PrimaryContact.__pulumiType = 'aws:account/primaryContact:PrimaryContact';
//# sourceMappingURL=primaryContact.js.map