@pulumiverse/dynatrace
Version:
A Pulumi package for creating and managing Dynatrace cloud resources.
130 lines • 5.83 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.getIamPoliciesOutput = exports.getIamPolicies = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > **Dynatrace SaaS only**
*
* > To utilize this resource, please define the environment variables `DT_CLIENT_ID`, `DT_CLIENT_SECRET`, `DT_ACCOUNT_ID` with an OAuth client including the following permissions: **Allow IAM policy configuration for environments** (`iam-policies-management`) and **View environments** (`account-env-read`).
*
* You can use the attributes `environments`, `accounts` and `globals` to refine which policies you want to query for.
* * The attribute `global` indicates whether the results should also contain global (Dynatrace defined) policies
* * The attribute `environment` is an array of environment IDs.
* * The results won't contain any environment specific policies if the attribute `environments` has been omitted
* * The results will contain policies for all environments reachable via the given credentials if `environments` is set to `["*"]`
* * The attribute `accounts` is an array of accounts UUIDs. Set this to `["*"]` if you want to receive account specific policies.
* * The results won't contain any account specific policies if the attribute `accounts` has been omitted
* ## Example Usage
*
* The following example queries for polices of all environments reachable via the given credentials, all accounts and all global policies.
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dynatrace from "@pulumi/dynatrace";
*
* const all = dynatrace.getIamPolicies({
* accounts: ["*"],
* environments: ["*"],
* global: true,
* });
* ```
* The following example queries for policies that are defined for the environment with the id `abce234`. No account specific or global policies will be included.
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dynatrace from "@pulumi/dynatrace";
*
* const all = dynatrace.getIamPolicies({
* environments: ["abce234"],
* global: false,
* });
* ```
*
* ## Example Output
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dynatrace from "@pulumi/dynatrace";
*
* const all = dynatrace.getIamPolicies({
* environments: ["*"],
* accounts: ["*"],
* global: true,
* });
* export const policies = all.then(all => all.policies);
* ```
*/
function getIamPolicies(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("dynatrace:index/getIamPolicies:getIamPolicies", {
"accounts": args.accounts,
"environments": args.environments,
"global": args.global,
"groups": args.groups,
}, opts);
}
exports.getIamPolicies = getIamPolicies;
/**
* > **Dynatrace SaaS only**
*
* > To utilize this resource, please define the environment variables `DT_CLIENT_ID`, `DT_CLIENT_SECRET`, `DT_ACCOUNT_ID` with an OAuth client including the following permissions: **Allow IAM policy configuration for environments** (`iam-policies-management`) and **View environments** (`account-env-read`).
*
* You can use the attributes `environments`, `accounts` and `globals` to refine which policies you want to query for.
* * The attribute `global` indicates whether the results should also contain global (Dynatrace defined) policies
* * The attribute `environment` is an array of environment IDs.
* * The results won't contain any environment specific policies if the attribute `environments` has been omitted
* * The results will contain policies for all environments reachable via the given credentials if `environments` is set to `["*"]`
* * The attribute `accounts` is an array of accounts UUIDs. Set this to `["*"]` if you want to receive account specific policies.
* * The results won't contain any account specific policies if the attribute `accounts` has been omitted
* ## Example Usage
*
* The following example queries for polices of all environments reachable via the given credentials, all accounts and all global policies.
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dynatrace from "@pulumi/dynatrace";
*
* const all = dynatrace.getIamPolicies({
* accounts: ["*"],
* environments: ["*"],
* global: true,
* });
* ```
* The following example queries for policies that are defined for the environment with the id `abce234`. No account specific or global policies will be included.
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dynatrace from "@pulumi/dynatrace";
*
* const all = dynatrace.getIamPolicies({
* environments: ["abce234"],
* global: false,
* });
* ```
*
* ## Example Output
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dynatrace from "@pulumi/dynatrace";
*
* const all = dynatrace.getIamPolicies({
* environments: ["*"],
* accounts: ["*"],
* global: true,
* });
* export const policies = all.then(all => all.policies);
* ```
*/
function getIamPoliciesOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("dynatrace:index/getIamPolicies:getIamPolicies", {
"accounts": args.accounts,
"environments": args.environments,
"global": args.global,
"groups": args.groups,
}, opts);
}
exports.getIamPoliciesOutput = getIamPoliciesOutput;
//# sourceMappingURL=getIamPolicies.js.map