@pulumi/ns1
Version:
A Pulumi package for creating and managing ns1 cloud resources.
166 lines • 9.96 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.APIKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a NS1 Api Key resource. This can be used to create, modify, and delete api keys.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as ns1 from "@pulumi/ns1";
*
* const example = new ns1.Team("example", {name: "Example team"});
* const exampleAPIKey = new ns1.APIKey("example", {
* name: "Example key",
* teams: [example.id],
* ipWhitelists: [
* "1.1.1.1",
* "2.2.2.2",
* ],
* dnsViewZones: false,
* accountManageUsers: false,
* });
* ```
*
* ## Permissions
*
* An API key will inherit permissions from the teams it is assigned to.
* If a key is assigned to a team and also has individual permissions set on the key, the individual permissions
* will be overridden by the inherited team permissions.
* In a future release, setting permissions on a key that is part of a team will be explicitly disabled.
*
* When a key is removed from all teams completely, it will inherit whatever permissions it had previously.
* If a key is removed from all it's teams, it will probably be necessary to run `pulumi up` a second time
* to update the keys permissions from it's old team permissions to new key-specific permissions.
*
* See [the NS1 API docs](https://ns1.com/api#getget-all-account-users) for an overview of permission semantics or for [more details](https://help.ns1.com/hc/en-us/articles/360024409034-Managing-user-permissions) about the individual permission flags.
*
* ## NS1 Documentation
*
* [ApiKeys Api Doc](https://ns1.com/api#api-key)
*
* ## Import
*
* -> Imported keys will not have their key stored in the state file.
*
* ```sh
* $ pulumi import ns1:index/aPIKey:APIKey `ns1_apikey`
* ```
*
* So for the example above:
*
* ```sh
* $ pulumi import ns1:index/aPIKey:APIKey example <ID>`
* ```
*/
class APIKey extends pulumi.CustomResource {
/**
* Get an existing APIKey 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 APIKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of APIKey. 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'] === APIKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountManageAccountSettings"] = state ? state.accountManageAccountSettings : undefined;
resourceInputs["accountManageApikeys"] = state ? state.accountManageApikeys : undefined;
resourceInputs["accountManageIpWhitelist"] = state ? state.accountManageIpWhitelist : undefined;
resourceInputs["accountManagePaymentMethods"] = state ? state.accountManagePaymentMethods : undefined;
resourceInputs["accountManagePlan"] = state ? state.accountManagePlan : undefined;
resourceInputs["accountManageTeams"] = state ? state.accountManageTeams : undefined;
resourceInputs["accountManageUsers"] = state ? state.accountManageUsers : undefined;
resourceInputs["accountViewActivityLog"] = state ? state.accountViewActivityLog : undefined;
resourceInputs["accountViewInvoices"] = state ? state.accountViewInvoices : undefined;
resourceInputs["dataManageDatafeeds"] = state ? state.dataManageDatafeeds : undefined;
resourceInputs["dataManageDatasources"] = state ? state.dataManageDatasources : undefined;
resourceInputs["dataPushToDatafeeds"] = state ? state.dataPushToDatafeeds : undefined;
resourceInputs["dnsManageZones"] = state ? state.dnsManageZones : undefined;
resourceInputs["dnsRecordsAllows"] = state ? state.dnsRecordsAllows : undefined;
resourceInputs["dnsRecordsDenies"] = state ? state.dnsRecordsDenies : undefined;
resourceInputs["dnsViewZones"] = state ? state.dnsViewZones : undefined;
resourceInputs["dnsZonesAllowByDefault"] = state ? state.dnsZonesAllowByDefault : undefined;
resourceInputs["dnsZonesAllows"] = state ? state.dnsZonesAllows : undefined;
resourceInputs["dnsZonesDenies"] = state ? state.dnsZonesDenies : undefined;
resourceInputs["ipWhitelistStrict"] = state ? state.ipWhitelistStrict : undefined;
resourceInputs["ipWhitelists"] = state ? state.ipWhitelists : undefined;
resourceInputs["key"] = state ? state.key : undefined;
resourceInputs["monitoringCreateJobs"] = state ? state.monitoringCreateJobs : undefined;
resourceInputs["monitoringDeleteJobs"] = state ? state.monitoringDeleteJobs : undefined;
resourceInputs["monitoringManageJobs"] = state ? state.monitoringManageJobs : undefined;
resourceInputs["monitoringManageLists"] = state ? state.monitoringManageLists : undefined;
resourceInputs["monitoringUpdateJobs"] = state ? state.monitoringUpdateJobs : undefined;
resourceInputs["monitoringViewJobs"] = state ? state.monitoringViewJobs : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["securityManageActiveDirectory"] = state ? state.securityManageActiveDirectory : undefined;
resourceInputs["securityManageGlobal2fa"] = state ? state.securityManageGlobal2fa : undefined;
resourceInputs["teams"] = state ? state.teams : undefined;
}
else {
const args = argsOrState;
resourceInputs["accountManageAccountSettings"] = args ? args.accountManageAccountSettings : undefined;
resourceInputs["accountManageApikeys"] = args ? args.accountManageApikeys : undefined;
resourceInputs["accountManageIpWhitelist"] = args ? args.accountManageIpWhitelist : undefined;
resourceInputs["accountManagePaymentMethods"] = args ? args.accountManagePaymentMethods : undefined;
resourceInputs["accountManagePlan"] = args ? args.accountManagePlan : undefined;
resourceInputs["accountManageTeams"] = args ? args.accountManageTeams : undefined;
resourceInputs["accountManageUsers"] = args ? args.accountManageUsers : undefined;
resourceInputs["accountViewActivityLog"] = args ? args.accountViewActivityLog : undefined;
resourceInputs["accountViewInvoices"] = args ? args.accountViewInvoices : undefined;
resourceInputs["dataManageDatafeeds"] = args ? args.dataManageDatafeeds : undefined;
resourceInputs["dataManageDatasources"] = args ? args.dataManageDatasources : undefined;
resourceInputs["dataPushToDatafeeds"] = args ? args.dataPushToDatafeeds : undefined;
resourceInputs["dnsManageZones"] = args ? args.dnsManageZones : undefined;
resourceInputs["dnsRecordsAllows"] = args ? args.dnsRecordsAllows : undefined;
resourceInputs["dnsRecordsDenies"] = args ? args.dnsRecordsDenies : undefined;
resourceInputs["dnsViewZones"] = args ? args.dnsViewZones : undefined;
resourceInputs["dnsZonesAllowByDefault"] = args ? args.dnsZonesAllowByDefault : undefined;
resourceInputs["dnsZonesAllows"] = args ? args.dnsZonesAllows : undefined;
resourceInputs["dnsZonesDenies"] = args ? args.dnsZonesDenies : undefined;
resourceInputs["ipWhitelistStrict"] = args ? args.ipWhitelistStrict : undefined;
resourceInputs["ipWhitelists"] = args ? args.ipWhitelists : undefined;
resourceInputs["monitoringCreateJobs"] = args ? args.monitoringCreateJobs : undefined;
resourceInputs["monitoringDeleteJobs"] = args ? args.monitoringDeleteJobs : undefined;
resourceInputs["monitoringManageJobs"] = args ? args.monitoringManageJobs : undefined;
resourceInputs["monitoringManageLists"] = args ? args.monitoringManageLists : undefined;
resourceInputs["monitoringUpdateJobs"] = args ? args.monitoringUpdateJobs : undefined;
resourceInputs["monitoringViewJobs"] = args ? args.monitoringViewJobs : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["securityManageActiveDirectory"] = args ? args.securityManageActiveDirectory : undefined;
resourceInputs["securityManageGlobal2fa"] = args ? args.securityManageGlobal2fa : undefined;
resourceInputs["teams"] = args ? args.teams : undefined;
resourceInputs["key"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["key"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(APIKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.APIKey = APIKey;
/** @internal */
APIKey.__pulumiType = 'ns1:index/aPIKey:APIKey';
//# sourceMappingURL=apikey.js.map