@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
114 lines • 3.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.getExperimentTemplatesOutput = exports.getExperimentTemplates = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* This resource can be useful for getting back a set of FIS experiment template IDs.
*
* ## Example Usage
*
* The following shows outputting a list of all FIS experiment template IDs
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* export = async () => {
* const all = await aws.fis.getExperimentTemplates({});
* return {
* all: all.ids,
* };
* }
* ```
*
* The following shows filtering FIS experiment templates by tag
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.fis.getExperimentTemplates({
* tags: {
* Name: "example",
* Tier: "1",
* },
* });
* const exampleGetPolicyDocument = example.then(example => aws.iam.getPolicyDocument({
* statements: [{
* sid: "StartFISExperiment",
* effect: "Allow",
* actions: ["fis:StartExperiment"],
* resources: [
* `arn:aws:fis:*:*:experiment-template/${example.ids?.[0]}`,
* "arn:aws:fis:*:*:experiment/*",
* ],
* }],
* }));
* ```
*/
function getExperimentTemplates(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:fis/getExperimentTemplates:getExperimentTemplates", {
"region": args.region,
"tags": args.tags,
}, opts);
}
exports.getExperimentTemplates = getExperimentTemplates;
/**
* This resource can be useful for getting back a set of FIS experiment template IDs.
*
* ## Example Usage
*
* The following shows outputting a list of all FIS experiment template IDs
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* export = async () => {
* const all = await aws.fis.getExperimentTemplates({});
* return {
* all: all.ids,
* };
* }
* ```
*
* The following shows filtering FIS experiment templates by tag
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.fis.getExperimentTemplates({
* tags: {
* Name: "example",
* Tier: "1",
* },
* });
* const exampleGetPolicyDocument = example.then(example => aws.iam.getPolicyDocument({
* statements: [{
* sid: "StartFISExperiment",
* effect: "Allow",
* actions: ["fis:StartExperiment"],
* resources: [
* `arn:aws:fis:*:*:experiment-template/${example.ids?.[0]}`,
* "arn:aws:fis:*:*:experiment/*",
* ],
* }],
* }));
* ```
*/
function getExperimentTemplatesOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("aws:fis/getExperimentTemplates:getExperimentTemplates", {
"region": args.region,
"tags": args.tags,
}, opts);
}
exports.getExperimentTemplatesOutput = getExperimentTemplatesOutput;
//# sourceMappingURL=getExperimentTemplates.js.map
;