@three14/pulumi-argocd 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/project.d.ts ADDED
@@ -0,0 +1,202 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ import * as inputs from "./types/input";
3
+ import * as outputs from "./types/output";
4
+ /**
5
+ * Manages [projects](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/) within ArgoCD.
6
+ *
7
+ * ## Example Usage
8
+ *
9
+ * ```typescript
10
+ * import * as pulumi from "@pulumi/pulumi";
11
+ * import * as argocd from "@three14/pulumi-argocd";
12
+ *
13
+ * const myproject = new argocd.Project("myproject", {
14
+ * metadata: {
15
+ * name: "myproject",
16
+ * namespace: "argocd",
17
+ * labels: {
18
+ * acceptance: "true",
19
+ * },
20
+ * annotations: {
21
+ * "this.is.a.really.long.nested.key": "yes, really!",
22
+ * },
23
+ * },
24
+ * spec: {
25
+ * description: "simple project",
26
+ * sourceNamespaces: ["argocd"],
27
+ * sourceRepos: ["*"],
28
+ * destinations: [
29
+ * {
30
+ * server: "https://kubernetes.default.svc",
31
+ * namespace: "default",
32
+ * },
33
+ * {
34
+ * server: "https://kubernetes.default.svc",
35
+ * namespace: "foo",
36
+ * },
37
+ * {
38
+ * name: "anothercluster",
39
+ * namespace: "bar",
40
+ * },
41
+ * ],
42
+ * clusterResourceBlacklists: [{
43
+ * group: "*",
44
+ * kind: "*",
45
+ * }],
46
+ * clusterResourceWhitelists: [
47
+ * {
48
+ * group: "rbac.authorization.k8s.io",
49
+ * kind: "ClusterRoleBinding",
50
+ * },
51
+ * {
52
+ * group: "rbac.authorization.k8s.io",
53
+ * kind: "ClusterRole",
54
+ * },
55
+ * ],
56
+ * namespaceResourceBlacklists: [{
57
+ * group: "networking.k8s.io",
58
+ * kind: "Ingress",
59
+ * }],
60
+ * namespaceResourceWhitelists: [{
61
+ * group: "*",
62
+ * kind: "*",
63
+ * }],
64
+ * orphanedResources: [{
65
+ * warn: true,
66
+ * ignores: [
67
+ * {
68
+ * group: "apps/v1",
69
+ * kind: "Deployment",
70
+ * name: "ignored1",
71
+ * },
72
+ * {
73
+ * group: "apps/v1",
74
+ * kind: "Deployment",
75
+ * name: "ignored2",
76
+ * },
77
+ * ],
78
+ * }],
79
+ * roles: [
80
+ * {
81
+ * name: "testrole",
82
+ * policies: [
83
+ * "p, proj:myproject:testrole, applications, override, myproject/*, allow",
84
+ * "p, proj:myproject:testrole, applications, sync, myproject/*, allow",
85
+ * "p, proj:myproject:testrole, clusters, get, myproject/*, allow",
86
+ * "p, proj:myproject:testrole, repositories, create, myproject/*, allow",
87
+ * "p, proj:myproject:testrole, repositories, delete, myproject/*, allow",
88
+ * "p, proj:myproject:testrole, repositories, update, myproject/*, allow",
89
+ * "p, proj:myproject:testrole, logs, get, myproject/*, allow",
90
+ * "p, proj:myproject:testrole, exec, create, myproject/*, allow",
91
+ * ],
92
+ * },
93
+ * {
94
+ * name: "anotherrole",
95
+ * policies: [
96
+ * "p, proj:myproject:testrole, applications, get, myproject/*, allow",
97
+ * "p, proj:myproject:testrole, applications, sync, myproject/*, deny",
98
+ * ],
99
+ * },
100
+ * ],
101
+ * syncWindows: [
102
+ * {
103
+ * kind: "allow",
104
+ * applications: ["api-*"],
105
+ * clusters: ["*"],
106
+ * namespaces: ["*"],
107
+ * duration: "3600s",
108
+ * schedule: "10 1 * * *",
109
+ * manualSync: true,
110
+ * },
111
+ * {
112
+ * useAndOperator: true,
113
+ * kind: "deny",
114
+ * applications: [
115
+ * "foo",
116
+ * "bar",
117
+ * ],
118
+ * clusters: ["in-cluster"],
119
+ * namespaces: ["default"],
120
+ * duration: "12h",
121
+ * schedule: "22 1 5 * *",
122
+ * manualSync: false,
123
+ * timezone: "Europe/London",
124
+ * },
125
+ * ],
126
+ * signatureKeys: [
127
+ * "4AEE18F83AFDEB23",
128
+ * "07E34825A909B250",
129
+ * ],
130
+ * },
131
+ * });
132
+ * ```
133
+ *
134
+ * ## Import
135
+ *
136
+ * The `pulumi import` command can be used, for example:
137
+ *
138
+ * Projects can be imported using the project name.
139
+ *
140
+ * ```sh
141
+ * $ pulumi import argocd:index/project:Project myproject myproject
142
+ * ```
143
+ */
144
+ export declare class Project extends pulumi.CustomResource {
145
+ /**
146
+ * Get an existing Project resource's state with the given name, ID, and optional extra
147
+ * properties used to qualify the lookup.
148
+ *
149
+ * @param name The _unique_ name of the resulting resource.
150
+ * @param id The _unique_ provider ID of the resource to lookup.
151
+ * @param state Any extra arguments used during the lookup.
152
+ * @param opts Optional settings to control the behavior of the CustomResource.
153
+ */
154
+ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ProjectState, opts?: pulumi.CustomResourceOptions): Project;
155
+ /**
156
+ * Returns true if the given object is an instance of Project. This is designed to work even
157
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
158
+ */
159
+ static isInstance(obj: any): obj is Project;
160
+ /**
161
+ * Standard Kubernetes object metadata. For more info see the [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata).
162
+ */
163
+ readonly metadata: pulumi.Output<outputs.ProjectMetadata>;
164
+ /**
165
+ * ArgoCD AppProject spec.
166
+ */
167
+ readonly spec: pulumi.Output<outputs.ProjectSpec>;
168
+ /**
169
+ * Create a Project resource with the given unique name, arguments, and options.
170
+ *
171
+ * @param name The _unique_ name of the resource.
172
+ * @param args The arguments to use to populate this resource's properties.
173
+ * @param opts A bag of options that control this resource's behavior.
174
+ */
175
+ constructor(name: string, args: ProjectArgs, opts?: pulumi.CustomResourceOptions);
176
+ }
177
+ /**
178
+ * Input properties used for looking up and filtering Project resources.
179
+ */
180
+ export interface ProjectState {
181
+ /**
182
+ * Standard Kubernetes object metadata. For more info see the [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata).
183
+ */
184
+ metadata?: pulumi.Input<inputs.ProjectMetadata>;
185
+ /**
186
+ * ArgoCD AppProject spec.
187
+ */
188
+ spec?: pulumi.Input<inputs.ProjectSpec>;
189
+ }
190
+ /**
191
+ * The set of arguments for constructing a Project resource.
192
+ */
193
+ export interface ProjectArgs {
194
+ /**
195
+ * Standard Kubernetes object metadata. For more info see the [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata).
196
+ */
197
+ metadata: pulumi.Input<inputs.ProjectMetadata>;
198
+ /**
199
+ * ArgoCD AppProject spec.
200
+ */
201
+ spec: pulumi.Input<inputs.ProjectSpec>;
202
+ }
package/project.js ADDED
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.Project = void 0;
6
+ const pulumi = require("@pulumi/pulumi");
7
+ const utilities = require("./utilities");
8
+ /**
9
+ * Manages [projects](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/) within ArgoCD.
10
+ *
11
+ * ## Example Usage
12
+ *
13
+ * ```typescript
14
+ * import * as pulumi from "@pulumi/pulumi";
15
+ * import * as argocd from "@three14/pulumi-argocd";
16
+ *
17
+ * const myproject = new argocd.Project("myproject", {
18
+ * metadata: {
19
+ * name: "myproject",
20
+ * namespace: "argocd",
21
+ * labels: {
22
+ * acceptance: "true",
23
+ * },
24
+ * annotations: {
25
+ * "this.is.a.really.long.nested.key": "yes, really!",
26
+ * },
27
+ * },
28
+ * spec: {
29
+ * description: "simple project",
30
+ * sourceNamespaces: ["argocd"],
31
+ * sourceRepos: ["*"],
32
+ * destinations: [
33
+ * {
34
+ * server: "https://kubernetes.default.svc",
35
+ * namespace: "default",
36
+ * },
37
+ * {
38
+ * server: "https://kubernetes.default.svc",
39
+ * namespace: "foo",
40
+ * },
41
+ * {
42
+ * name: "anothercluster",
43
+ * namespace: "bar",
44
+ * },
45
+ * ],
46
+ * clusterResourceBlacklists: [{
47
+ * group: "*",
48
+ * kind: "*",
49
+ * }],
50
+ * clusterResourceWhitelists: [
51
+ * {
52
+ * group: "rbac.authorization.k8s.io",
53
+ * kind: "ClusterRoleBinding",
54
+ * },
55
+ * {
56
+ * group: "rbac.authorization.k8s.io",
57
+ * kind: "ClusterRole",
58
+ * },
59
+ * ],
60
+ * namespaceResourceBlacklists: [{
61
+ * group: "networking.k8s.io",
62
+ * kind: "Ingress",
63
+ * }],
64
+ * namespaceResourceWhitelists: [{
65
+ * group: "*",
66
+ * kind: "*",
67
+ * }],
68
+ * orphanedResources: [{
69
+ * warn: true,
70
+ * ignores: [
71
+ * {
72
+ * group: "apps/v1",
73
+ * kind: "Deployment",
74
+ * name: "ignored1",
75
+ * },
76
+ * {
77
+ * group: "apps/v1",
78
+ * kind: "Deployment",
79
+ * name: "ignored2",
80
+ * },
81
+ * ],
82
+ * }],
83
+ * roles: [
84
+ * {
85
+ * name: "testrole",
86
+ * policies: [
87
+ * "p, proj:myproject:testrole, applications, override, myproject/*, allow",
88
+ * "p, proj:myproject:testrole, applications, sync, myproject/*, allow",
89
+ * "p, proj:myproject:testrole, clusters, get, myproject/*, allow",
90
+ * "p, proj:myproject:testrole, repositories, create, myproject/*, allow",
91
+ * "p, proj:myproject:testrole, repositories, delete, myproject/*, allow",
92
+ * "p, proj:myproject:testrole, repositories, update, myproject/*, allow",
93
+ * "p, proj:myproject:testrole, logs, get, myproject/*, allow",
94
+ * "p, proj:myproject:testrole, exec, create, myproject/*, allow",
95
+ * ],
96
+ * },
97
+ * {
98
+ * name: "anotherrole",
99
+ * policies: [
100
+ * "p, proj:myproject:testrole, applications, get, myproject/*, allow",
101
+ * "p, proj:myproject:testrole, applications, sync, myproject/*, deny",
102
+ * ],
103
+ * },
104
+ * ],
105
+ * syncWindows: [
106
+ * {
107
+ * kind: "allow",
108
+ * applications: ["api-*"],
109
+ * clusters: ["*"],
110
+ * namespaces: ["*"],
111
+ * duration: "3600s",
112
+ * schedule: "10 1 * * *",
113
+ * manualSync: true,
114
+ * },
115
+ * {
116
+ * useAndOperator: true,
117
+ * kind: "deny",
118
+ * applications: [
119
+ * "foo",
120
+ * "bar",
121
+ * ],
122
+ * clusters: ["in-cluster"],
123
+ * namespaces: ["default"],
124
+ * duration: "12h",
125
+ * schedule: "22 1 5 * *",
126
+ * manualSync: false,
127
+ * timezone: "Europe/London",
128
+ * },
129
+ * ],
130
+ * signatureKeys: [
131
+ * "4AEE18F83AFDEB23",
132
+ * "07E34825A909B250",
133
+ * ],
134
+ * },
135
+ * });
136
+ * ```
137
+ *
138
+ * ## Import
139
+ *
140
+ * The `pulumi import` command can be used, for example:
141
+ *
142
+ * Projects can be imported using the project name.
143
+ *
144
+ * ```sh
145
+ * $ pulumi import argocd:index/project:Project myproject myproject
146
+ * ```
147
+ */
148
+ class Project extends pulumi.CustomResource {
149
+ /**
150
+ * Get an existing Project resource's state with the given name, ID, and optional extra
151
+ * properties used to qualify the lookup.
152
+ *
153
+ * @param name The _unique_ name of the resulting resource.
154
+ * @param id The _unique_ provider ID of the resource to lookup.
155
+ * @param state Any extra arguments used during the lookup.
156
+ * @param opts Optional settings to control the behavior of the CustomResource.
157
+ */
158
+ static get(name, id, state, opts) {
159
+ return new Project(name, state, { ...opts, id: id });
160
+ }
161
+ /**
162
+ * Returns true if the given object is an instance of Project. This is designed to work even
163
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
164
+ */
165
+ static isInstance(obj) {
166
+ if (obj === undefined || obj === null) {
167
+ return false;
168
+ }
169
+ return obj['__pulumiType'] === Project.__pulumiType;
170
+ }
171
+ constructor(name, argsOrState, opts) {
172
+ let resourceInputs = {};
173
+ opts = opts || {};
174
+ if (opts.id) {
175
+ const state = argsOrState;
176
+ resourceInputs["metadata"] = state?.metadata;
177
+ resourceInputs["spec"] = state?.spec;
178
+ }
179
+ else {
180
+ const args = argsOrState;
181
+ if (args?.metadata === undefined && !opts.urn) {
182
+ throw new Error("Missing required property 'metadata'");
183
+ }
184
+ if (args?.spec === undefined && !opts.urn) {
185
+ throw new Error("Missing required property 'spec'");
186
+ }
187
+ resourceInputs["metadata"] = args?.metadata;
188
+ resourceInputs["spec"] = args?.spec;
189
+ }
190
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
191
+ super(Project.__pulumiType, name, resourceInputs, opts);
192
+ }
193
+ }
194
+ exports.Project = Project;
195
+ /** @internal */
196
+ Project.__pulumiType = 'argocd:index/project:Project';
197
+ //# sourceMappingURL=project.js.map
package/project.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../project.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AAGzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2IG;AACH,MAAa,OAAQ,SAAQ,MAAM,CAAC,cAAc;IAC9C;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAoB,EAAE,IAAmC;QAClH,OAAO,IAAI,OAAO,CAAC,IAAI,EAAO,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;IAKD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC;IACxD,CAAC;IAmBD,YAAY,IAAY,EAAE,WAAwC,EAAE,IAAmC;QACnG,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,MAAM,KAAK,GAAG,WAAuC,CAAC;YACtD,cAAc,CAAC,UAAU,CAAC,GAAG,KAAK,EAAE,QAAQ,CAAC;YAC7C,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC;SACxC;aAAM;YACH,MAAM,IAAI,GAAG,WAAsC,CAAC;YACpD,IAAI,IAAI,EAAE,QAAQ,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC3C,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;aAC3D;YACD,IAAI,IAAI,EAAE,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;aACvD;YACD,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC;YAC5C,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC;SACvC;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;;AAjEL,0BAkEC;AApDG,gBAAgB;AACO,oBAAY,GAAG,8BAA8B,CAAC"}
@@ -0,0 +1,152 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ /**
3
+ * Manages ArgoCD project role JWT tokens. See [Project Roles](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#project-roles) for more info.
4
+ *
5
+ * > **Security Notice** The JWT token generated by this resource is treated as sensitive and, thus, not displayed in console output. However, it will be stored *unencrypted* in your Terraform state file. Read more about sensitive data handling in the Terraform documentation.
6
+ *
7
+ * ## Example Usage
8
+ *
9
+ * ```typescript
10
+ * import * as pulumi from "@pulumi/pulumi";
11
+ * import * as argocd from "@three14/pulumi-argocd";
12
+ *
13
+ * const secret = new argocd.ProjectToken("secret", {
14
+ * project: "someproject",
15
+ * role: "foobar",
16
+ * description: "short lived token",
17
+ * expiresIn: "1h",
18
+ * renewBefore: "30m",
19
+ * });
20
+ * ```
21
+ */
22
+ export declare class ProjectToken extends pulumi.CustomResource {
23
+ /**
24
+ * Get an existing ProjectToken resource's state with the given name, ID, and optional extra
25
+ * properties used to qualify the lookup.
26
+ *
27
+ * @param name The _unique_ name of the resulting resource.
28
+ * @param id The _unique_ provider ID of the resource to lookup.
29
+ * @param state Any extra arguments used during the lookup.
30
+ * @param opts Optional settings to control the behavior of the CustomResource.
31
+ */
32
+ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ProjectTokenState, opts?: pulumi.CustomResourceOptions): ProjectToken;
33
+ /**
34
+ * Returns true if the given object is an instance of ProjectToken. This is designed to work even
35
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
36
+ */
37
+ static isInstance(obj: any): obj is ProjectToken;
38
+ /**
39
+ * Description of the token.
40
+ */
41
+ readonly description: pulumi.Output<string | undefined>;
42
+ /**
43
+ * If `expiresIn` is set, Unix timestamp upon which the token will expire.
44
+ */
45
+ readonly expiresAt: pulumi.Output<string>;
46
+ /**
47
+ * Duration before the token will expire. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. E.g. `30m`, `12h`. Default: No expiration.
48
+ */
49
+ readonly expiresIn: pulumi.Output<string | undefined>;
50
+ /**
51
+ * Unix timestamp at which the token was issued.
52
+ */
53
+ readonly issuedAt: pulumi.Output<string>;
54
+ /**
55
+ * The raw JWT.
56
+ */
57
+ readonly jwt: pulumi.Output<string>;
58
+ /**
59
+ * The project associated with the token.
60
+ */
61
+ readonly project: pulumi.Output<string>;
62
+ /**
63
+ * Duration to control token silent regeneration based on token age. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. If set, then the token will be regenerated if it is older than `renewAfter`. I.e. if `currentDate - issuedAt > renewAfter`.
64
+ */
65
+ readonly renewAfter: pulumi.Output<string | undefined>;
66
+ /**
67
+ * Duration to control token silent regeneration based on remaining token lifetime. If `expiresIn` is set, the provider will regenerate the token if `expiresAt - currentDate < renewBefore`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
68
+ */
69
+ readonly renewBefore: pulumi.Output<string | undefined>;
70
+ /**
71
+ * The name of the role in the project associated with the token.
72
+ */
73
+ readonly role: pulumi.Output<string>;
74
+ /**
75
+ * Create a ProjectToken resource with the given unique name, arguments, and options.
76
+ *
77
+ * @param name The _unique_ name of the resource.
78
+ * @param args The arguments to use to populate this resource's properties.
79
+ * @param opts A bag of options that control this resource's behavior.
80
+ */
81
+ constructor(name: string, args: ProjectTokenArgs, opts?: pulumi.CustomResourceOptions);
82
+ }
83
+ /**
84
+ * Input properties used for looking up and filtering ProjectToken resources.
85
+ */
86
+ export interface ProjectTokenState {
87
+ /**
88
+ * Description of the token.
89
+ */
90
+ description?: pulumi.Input<string>;
91
+ /**
92
+ * If `expiresIn` is set, Unix timestamp upon which the token will expire.
93
+ */
94
+ expiresAt?: pulumi.Input<string>;
95
+ /**
96
+ * Duration before the token will expire. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. E.g. `30m`, `12h`. Default: No expiration.
97
+ */
98
+ expiresIn?: pulumi.Input<string>;
99
+ /**
100
+ * Unix timestamp at which the token was issued.
101
+ */
102
+ issuedAt?: pulumi.Input<string>;
103
+ /**
104
+ * The raw JWT.
105
+ */
106
+ jwt?: pulumi.Input<string>;
107
+ /**
108
+ * The project associated with the token.
109
+ */
110
+ project?: pulumi.Input<string>;
111
+ /**
112
+ * Duration to control token silent regeneration based on token age. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. If set, then the token will be regenerated if it is older than `renewAfter`. I.e. if `currentDate - issuedAt > renewAfter`.
113
+ */
114
+ renewAfter?: pulumi.Input<string>;
115
+ /**
116
+ * Duration to control token silent regeneration based on remaining token lifetime. If `expiresIn` is set, the provider will regenerate the token if `expiresAt - currentDate < renewBefore`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
117
+ */
118
+ renewBefore?: pulumi.Input<string>;
119
+ /**
120
+ * The name of the role in the project associated with the token.
121
+ */
122
+ role?: pulumi.Input<string>;
123
+ }
124
+ /**
125
+ * The set of arguments for constructing a ProjectToken resource.
126
+ */
127
+ export interface ProjectTokenArgs {
128
+ /**
129
+ * Description of the token.
130
+ */
131
+ description?: pulumi.Input<string>;
132
+ /**
133
+ * Duration before the token will expire. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. E.g. `30m`, `12h`. Default: No expiration.
134
+ */
135
+ expiresIn?: pulumi.Input<string>;
136
+ /**
137
+ * The project associated with the token.
138
+ */
139
+ project: pulumi.Input<string>;
140
+ /**
141
+ * Duration to control token silent regeneration based on token age. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. If set, then the token will be regenerated if it is older than `renewAfter`. I.e. if `currentDate - issuedAt > renewAfter`.
142
+ */
143
+ renewAfter?: pulumi.Input<string>;
144
+ /**
145
+ * Duration to control token silent regeneration based on remaining token lifetime. If `expiresIn` is set, the provider will regenerate the token if `expiresAt - currentDate < renewBefore`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
146
+ */
147
+ renewBefore?: pulumi.Input<string>;
148
+ /**
149
+ * The name of the role in the project associated with the token.
150
+ */
151
+ role: pulumi.Input<string>;
152
+ }
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.ProjectToken = void 0;
6
+ const pulumi = require("@pulumi/pulumi");
7
+ const utilities = require("./utilities");
8
+ /**
9
+ * Manages ArgoCD project role JWT tokens. See [Project Roles](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#project-roles) for more info.
10
+ *
11
+ * > **Security Notice** The JWT token generated by this resource is treated as sensitive and, thus, not displayed in console output. However, it will be stored *unencrypted* in your Terraform state file. Read more about sensitive data handling in the Terraform documentation.
12
+ *
13
+ * ## Example Usage
14
+ *
15
+ * ```typescript
16
+ * import * as pulumi from "@pulumi/pulumi";
17
+ * import * as argocd from "@three14/pulumi-argocd";
18
+ *
19
+ * const secret = new argocd.ProjectToken("secret", {
20
+ * project: "someproject",
21
+ * role: "foobar",
22
+ * description: "short lived token",
23
+ * expiresIn: "1h",
24
+ * renewBefore: "30m",
25
+ * });
26
+ * ```
27
+ */
28
+ class ProjectToken extends pulumi.CustomResource {
29
+ /**
30
+ * Get an existing ProjectToken resource's state with the given name, ID, and optional extra
31
+ * properties used to qualify the lookup.
32
+ *
33
+ * @param name The _unique_ name of the resulting resource.
34
+ * @param id The _unique_ provider ID of the resource to lookup.
35
+ * @param state Any extra arguments used during the lookup.
36
+ * @param opts Optional settings to control the behavior of the CustomResource.
37
+ */
38
+ static get(name, id, state, opts) {
39
+ return new ProjectToken(name, state, { ...opts, id: id });
40
+ }
41
+ /**
42
+ * Returns true if the given object is an instance of ProjectToken. This is designed to work even
43
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
44
+ */
45
+ static isInstance(obj) {
46
+ if (obj === undefined || obj === null) {
47
+ return false;
48
+ }
49
+ return obj['__pulumiType'] === ProjectToken.__pulumiType;
50
+ }
51
+ constructor(name, argsOrState, opts) {
52
+ let resourceInputs = {};
53
+ opts = opts || {};
54
+ if (opts.id) {
55
+ const state = argsOrState;
56
+ resourceInputs["description"] = state?.description;
57
+ resourceInputs["expiresAt"] = state?.expiresAt;
58
+ resourceInputs["expiresIn"] = state?.expiresIn;
59
+ resourceInputs["issuedAt"] = state?.issuedAt;
60
+ resourceInputs["jwt"] = state?.jwt;
61
+ resourceInputs["project"] = state?.project;
62
+ resourceInputs["renewAfter"] = state?.renewAfter;
63
+ resourceInputs["renewBefore"] = state?.renewBefore;
64
+ resourceInputs["role"] = state?.role;
65
+ }
66
+ else {
67
+ const args = argsOrState;
68
+ if (args?.project === undefined && !opts.urn) {
69
+ throw new Error("Missing required property 'project'");
70
+ }
71
+ if (args?.role === undefined && !opts.urn) {
72
+ throw new Error("Missing required property 'role'");
73
+ }
74
+ resourceInputs["description"] = args?.description;
75
+ resourceInputs["expiresIn"] = args?.expiresIn;
76
+ resourceInputs["project"] = args?.project;
77
+ resourceInputs["renewAfter"] = args?.renewAfter;
78
+ resourceInputs["renewBefore"] = args?.renewBefore;
79
+ resourceInputs["role"] = args?.role;
80
+ resourceInputs["expiresAt"] = undefined /*out*/;
81
+ resourceInputs["issuedAt"] = undefined /*out*/;
82
+ resourceInputs["jwt"] = undefined /*out*/;
83
+ }
84
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
85
+ const secretOpts = { additionalSecretOutputs: ["jwt"] };
86
+ opts = pulumi.mergeOptions(opts, secretOpts);
87
+ super(ProjectToken.__pulumiType, name, resourceInputs, opts);
88
+ }
89
+ }
90
+ exports.ProjectToken = ProjectToken;
91
+ /** @internal */
92
+ ProjectToken.__pulumiType = 'argocd:index/projectToken:ProjectToken';
93
+ //# sourceMappingURL=projectToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectToken.js","sourceRoot":"","sources":["../projectToken.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,YAAa,SAAQ,MAAM,CAAC,cAAc;IACnD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAyB,EAAE,IAAmC;QACvH,OAAO,IAAI,YAAY,CAAC,IAAI,EAAO,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACnE,CA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