@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
64 lines • 2.17 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.getResourceOutput = exports.getResource = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Use this data source to get the id of a Resource in API Gateway.
* To fetch the Resource, you must provide the REST API id as well as the full path.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const myRestApi = aws.apigateway.getRestApi({
* name: "my-rest-api",
* });
* const myResource = myRestApi.then(myRestApi => aws.apigateway.getResource({
* restApiId: myRestApi.id,
* path: "/endpoint/path",
* }));
* ```
*/
function getResource(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:apigateway/getResource:getResource", {
"path": args.path,
"region": args.region,
"restApiId": args.restApiId,
}, opts);
}
exports.getResource = getResource;
/**
* Use this data source to get the id of a Resource in API Gateway.
* To fetch the Resource, you must provide the REST API id as well as the full path.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const myRestApi = aws.apigateway.getRestApi({
* name: "my-rest-api",
* });
* const myResource = myRestApi.then(myRestApi => aws.apigateway.getResource({
* restApiId: myRestApi.id,
* path: "/endpoint/path",
* }));
* ```
*/
function getResourceOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("aws:apigateway/getResource:getResource", {
"path": args.path,
"region": args.region,
"restApiId": args.restApiId,
}, opts);
}
exports.getResourceOutput = getResourceOutput;
//# sourceMappingURL=getResource.js.map
;