@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
194 lines • 7.09 kB
JavaScript
"use strict";
// *** 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.getCoreNetworkPolicyDocumentOutput = exports.getCoreNetworkPolicyDocument = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Generates a Core Network policy document in JSON format for use with resources that expect core network policy documents such as `awsccNetworkmanagerCoreNetwork`. It follows the API definition from the [core-network-policy documentation](https://docs.aws.amazon.com/vpc/latest/cloudwan/cloudwan-policies-json.html).
*
* Using this data source to generate policy documents is *optional*. It is also valid to use literal JSON strings in your configuration or to use the `file` interpolation function to read a raw JSON policy document from a file.
*
* ## Example Usage
*
* ### Basic Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = aws.networkmanager.getCoreNetworkPolicyDocument({
* coreNetworkConfigurations: [{
* vpnEcmpSupport: false,
* asnRanges: ["64512-64555"],
* edgeLocations: [
* {
* location: "us-east-1",
* asn: "64512",
* },
* {
* location: "eu-central-1",
* asn: "64513",
* },
* ],
* }],
* segments: [
* {
* name: "shared",
* description: "Segment for shared services",
* requireAttachmentAcceptance: true,
* },
* {
* name: "prod",
* description: "Segment for prod services",
* requireAttachmentAcceptance: true,
* },
* ],
* segmentActions: [{
* action: "share",
* mode: "attachment-route",
* segment: "shared",
* shareWiths: ["*"],
* }],
* attachmentPolicies: [
* {
* ruleNumber: 100,
* conditionLogic: "or",
* conditions: [{
* type: "tag-value",
* operator: "equals",
* key: "segment",
* value: "shared",
* }],
* action: {
* associationMethod: "constant",
* segment: "shared",
* },
* },
* {
* ruleNumber: 200,
* conditionLogic: "or",
* conditions: [{
* type: "tag-value",
* operator: "equals",
* key: "segment",
* value: "prod",
* }],
* action: {
* associationMethod: "constant",
* segment: "prod",
* },
* },
* ],
* });
* ```
*
* `data.aws_networkmanager_core_network_policy_document.test.json` will evaluate to:
*/
function getCoreNetworkPolicyDocument(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:networkmanager/getCoreNetworkPolicyDocument:getCoreNetworkPolicyDocument", {
"attachmentPolicies": args.attachmentPolicies,
"coreNetworkConfigurations": args.coreNetworkConfigurations,
"networkFunctionGroups": args.networkFunctionGroups,
"segmentActions": args.segmentActions,
"segments": args.segments,
"version": args.version,
}, opts);
}
exports.getCoreNetworkPolicyDocument = getCoreNetworkPolicyDocument;
/**
* Generates a Core Network policy document in JSON format for use with resources that expect core network policy documents such as `awsccNetworkmanagerCoreNetwork`. It follows the API definition from the [core-network-policy documentation](https://docs.aws.amazon.com/vpc/latest/cloudwan/cloudwan-policies-json.html).
*
* Using this data source to generate policy documents is *optional*. It is also valid to use literal JSON strings in your configuration or to use the `file` interpolation function to read a raw JSON policy document from a file.
*
* ## Example Usage
*
* ### Basic Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = aws.networkmanager.getCoreNetworkPolicyDocument({
* coreNetworkConfigurations: [{
* vpnEcmpSupport: false,
* asnRanges: ["64512-64555"],
* edgeLocations: [
* {
* location: "us-east-1",
* asn: "64512",
* },
* {
* location: "eu-central-1",
* asn: "64513",
* },
* ],
* }],
* segments: [
* {
* name: "shared",
* description: "Segment for shared services",
* requireAttachmentAcceptance: true,
* },
* {
* name: "prod",
* description: "Segment for prod services",
* requireAttachmentAcceptance: true,
* },
* ],
* segmentActions: [{
* action: "share",
* mode: "attachment-route",
* segment: "shared",
* shareWiths: ["*"],
* }],
* attachmentPolicies: [
* {
* ruleNumber: 100,
* conditionLogic: "or",
* conditions: [{
* type: "tag-value",
* operator: "equals",
* key: "segment",
* value: "shared",
* }],
* action: {
* associationMethod: "constant",
* segment: "shared",
* },
* },
* {
* ruleNumber: 200,
* conditionLogic: "or",
* conditions: [{
* type: "tag-value",
* operator: "equals",
* key: "segment",
* value: "prod",
* }],
* action: {
* associationMethod: "constant",
* segment: "prod",
* },
* },
* ],
* });
* ```
*
* `data.aws_networkmanager_core_network_policy_document.test.json` will evaluate to:
*/
function getCoreNetworkPolicyDocumentOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("aws:networkmanager/getCoreNetworkPolicyDocument:getCoreNetworkPolicyDocument", {
"attachmentPolicies": args.attachmentPolicies,
"coreNetworkConfigurations": args.coreNetworkConfigurations,
"networkFunctionGroups": args.networkFunctionGroups,
"segmentActions": args.segmentActions,
"segments": args.segments,
"version": args.version,
}, opts);
}
exports.getCoreNetworkPolicyDocumentOutput = getCoreNetworkPolicyDocumentOutput;
//# sourceMappingURL=getCoreNetworkPolicyDocument.js.map