@pulumiverse/dynatrace
Version:
A Pulumi package for creating and managing Dynatrace cloud resources.
173 lines (172 loc) • 7.58 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "./types/output";
/**
* > **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);
* ```
*/
export declare function getIamPolicies(args?: GetIamPoliciesArgs, opts?: pulumi.InvokeOptions): Promise<GetIamPoliciesResult>;
/**
* A collection of arguments for invoking getIamPolicies.
*/
export interface GetIamPoliciesArgs {
/**
* The results will contain policies defined for the given accountID. If one of the entries contains `*` the results will contain policies for all accounts
*/
accounts?: string[];
/**
* The results will contain policies defined for the given environments. If one of the entries contains `*` the results will contain policies for all environments
*/
environments?: string[];
/**
* If `true` the results will contain global policies
*/
global?: boolean;
/**
* The results will only contain policies that are bound to the specified groups. Omit this attribute if you want to retrieve all policies
*/
groups?: string[];
}
/**
* A collection of values returned by getIamPolicies.
*/
export interface GetIamPoliciesResult {
/**
* The results will contain policies defined for the given accountID. If one of the entries contains `*` the results will contain policies for all accounts
*/
readonly accounts?: string[];
/**
* The results will contain policies defined for the given environments. If one of the entries contains `*` the results will contain policies for all environments
*/
readonly environments?: string[];
/**
* If `true` the results will contain global policies
*/
readonly global?: boolean;
/**
* The results will only contain policies that are bound to the specified groups. Omit this attribute if you want to retrieve all policies
*/
readonly groups?: string[];
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly policies: outputs.GetIamPoliciesPolicy[];
}
/**
* > **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);
* ```
*/
export declare function getIamPoliciesOutput(args?: GetIamPoliciesOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetIamPoliciesResult>;
/**
* A collection of arguments for invoking getIamPolicies.
*/
export interface GetIamPoliciesOutputArgs {
/**
* The results will contain policies defined for the given accountID. If one of the entries contains `*` the results will contain policies for all accounts
*/
accounts?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The results will contain policies defined for the given environments. If one of the entries contains `*` the results will contain policies for all environments
*/
environments?: pulumi.Input<pulumi.Input<string>[]>;
/**
* If `true` the results will contain global policies
*/
global?: pulumi.Input<boolean>;
/**
* The results will only contain policies that are bound to the specified groups. Omit this attribute if you want to retrieve all policies
*/
groups?: pulumi.Input<pulumi.Input<string>[]>;
}