/
getSecret.ts
97 lines (93 loc) · 2.66 KB
/
getSecret.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
// *** 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";
/**
* Retrieve metadata information about a Secrets Manager secret. To retrieve a secret value, see the [`aws_secretsmanager_secret_version` data source](https://www.terraform.io/docs/providers/aws/d/secretsmanager_secret_version.html).
*
* ## Example Usage
*
* ### ARN
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const by_arn = pulumi.output(aws.secretsmanager.getSecret({
* arn: "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-123456",
* }));
* ```
*
* ### Name
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const by_name = pulumi.output(aws.secretsmanager.getSecret({
* name: "example",
* }));
* ```
*/
export function getSecret(args?: GetSecretArgs, opts?: pulumi.InvokeOptions): Promise<GetSecretResult> {
args = args || {};
return pulumi.runtime.invoke("aws:secretsmanager/getSecret:getSecret", {
"arn": args.arn,
"name": args.name,
}, opts);
}
/**
* A collection of arguments for invoking getSecret.
*/
export interface GetSecretArgs {
/**
* The Amazon Resource Name (ARN) of the secret to retrieve.
*/
readonly arn?: string;
/**
* The name of the secret to retrieve.
*/
readonly name?: string;
}
/**
* A collection of values returned by getSecret.
*/
export interface GetSecretResult {
/**
* The Amazon Resource Name (ARN) of the secret.
*/
readonly arn: string;
/**
* A description of the secret.
*/
readonly description: string;
/**
* The Key Management Service (KMS) Customer Master Key (CMK) associated with the secret.
*/
readonly kmsKeyId: string;
readonly name: string;
/**
* The resource-based policy document that's attached to the secret.
*/
readonly policy: string;
/**
* Whether rotation is enabled or not.
*/
readonly rotationEnabled: boolean;
/**
* Rotation Lambda function Amazon Resource Name (ARN) if rotation is enabled.
*/
readonly rotationLambdaArn: string;
/**
* Rotation rules if rotation is enabled.
*/
readonly rotationRules: { automaticallyAfterDays: number }[];
/**
* Tags of the secret.
*/
readonly tags: {[key: string]: any};
/**
* id is the provider-assigned unique ID for this managed resource.
*/
readonly id: string;
}