/
getPartition.ts
99 lines (93 loc) · 3.02 KB
/
getPartition.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
/**
* Use this data source to lookup information about the current AWS partition in
* which the provider is working.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getPartition({});
* const s3Policy = current.then(current => aws.iam.getPolicyDocument({
* statements: [{
* sid: "1",
* actions: ["s3:ListBucket"],
* resources: [`arn:${current.partition}:s3:::my-bucket`],
* }],
* }));
* ```
*/
export function getPartition(args?: GetPartitionArgs, opts?: pulumi.InvokeOptions): Promise<GetPartitionResult> {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:index/getPartition:getPartition", {
"id": args.id,
}, opts);
}
/**
* A collection of arguments for invoking getPartition.
*/
export interface GetPartitionArgs {
/**
* Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China).
*/
id?: string;
}
/**
* A collection of values returned by getPartition.
*/
export interface GetPartitionResult {
/**
* Base DNS domain name for the current partition (e.g., `amazonaws.com` in AWS Commercial, `amazonaws.com.cn` in AWS China).
*/
readonly dnsSuffix: string;
/**
* Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China).
*/
readonly id: string;
/**
* Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China).
*/
readonly partition: string;
/**
* Prefix of service names (e.g., `com.amazonaws` in AWS Commercial, `cn.com.amazonaws` in AWS China).
*/
readonly reverseDnsPrefix: string;
}
/**
* Use this data source to lookup information about the current AWS partition in
* which the provider is working.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getPartition({});
* const s3Policy = current.then(current => aws.iam.getPolicyDocument({
* statements: [{
* sid: "1",
* actions: ["s3:ListBucket"],
* resources: [`arn:${current.partition}:s3:::my-bucket`],
* }],
* }));
* ```
*/
export function getPartitionOutput(args?: GetPartitionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetPartitionResult> {
return pulumi.output(args).apply((a: any) => getPartition(a, opts))
}
/**
* A collection of arguments for invoking getPartition.
*/
export interface GetPartitionOutputArgs {
/**
* Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China).
*/
id?: pulumi.Input<string>;
}