@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
90 lines • 2.79 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.getCachePolicyOutput = exports.getCachePolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Use this data source to retrieve information about a CloudFront cache policy.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.cloudfront.getCachePolicy({
* name: "example-policy",
* });
* ```
*
* ### AWS-Managed Policies
*
* AWS managed cache policy names are prefixed with `Managed-`, except for `UseOriginCacheControlHeaders` and `UseOriginCacheControlHeaders-QueryStrings`:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example1 = aws.cloudfront.getCachePolicy({
* name: "Managed-CachingOptimized",
* });
* const example2 = aws.cloudfront.getCachePolicy({
* name: "UseOriginCacheControlHeaders",
* });
* ```
*/
function getCachePolicy(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:cloudfront/getCachePolicy:getCachePolicy", {
"id": args.id,
"name": args.name,
}, opts);
}
exports.getCachePolicy = getCachePolicy;
/**
* Use this data source to retrieve information about a CloudFront cache policy.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.cloudfront.getCachePolicy({
* name: "example-policy",
* });
* ```
*
* ### AWS-Managed Policies
*
* AWS managed cache policy names are prefixed with `Managed-`, except for `UseOriginCacheControlHeaders` and `UseOriginCacheControlHeaders-QueryStrings`:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example1 = aws.cloudfront.getCachePolicy({
* name: "Managed-CachingOptimized",
* });
* const example2 = aws.cloudfront.getCachePolicy({
* name: "UseOriginCacheControlHeaders",
* });
* ```
*/
function getCachePolicyOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("aws:cloudfront/getCachePolicy:getCachePolicy", {
"id": args.id,
"name": args.name,
}, opts);
}
exports.getCachePolicyOutput = getCachePolicyOutput;
//# sourceMappingURL=getCachePolicy.js.map
;