@pulumiverse/buildkite 2.3.0 → 3.0.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.
Files changed (97) hide show
  1. package/README.md +5 -0
  2. package/agent/agentToken.d.ts +11 -19
  3. package/agent/agentToken.js +4 -6
  4. package/agent/agentToken.js.map +1 -1
  5. package/cluster/cluster.d.ts +74 -20
  6. package/cluster/cluster.js +54 -6
  7. package/cluster/cluster.js.map +1 -1
  8. package/cluster/clusterAgentToken.d.ts +49 -15
  9. package/cluster/clusterAgentToken.js +26 -8
  10. package/cluster/clusterAgentToken.js.map +1 -1
  11. package/cluster/clusterDefaultQueue.d.ts +130 -0
  12. package/cluster/clusterDefaultQueue.js +121 -0
  13. package/cluster/clusterDefaultQueue.js.map +1 -0
  14. package/cluster/clusterQueue.d.ts +36 -44
  15. package/cluster/clusterQueue.js +29 -37
  16. package/cluster/clusterQueue.js.map +1 -1
  17. package/cluster/getCluster.d.ts +48 -5
  18. package/cluster/getCluster.js +40 -0
  19. package/cluster/getCluster.js.map +1 -1
  20. package/cluster/index.d.ts +3 -0
  21. package/cluster/index.js +6 -1
  22. package/cluster/index.js.map +1 -1
  23. package/config/vars.d.ts +11 -5
  24. package/config/vars.js +12 -0
  25. package/config/vars.js.map +1 -1
  26. package/getMeta.d.ts +49 -2
  27. package/getMeta.js +51 -1
  28. package/getMeta.js.map +1 -1
  29. package/index.d.ts +3 -1
  30. package/index.js +5 -2
  31. package/index.js.map +1 -1
  32. package/organization/banner.d.ts +104 -0
  33. package/organization/banner.js +102 -0
  34. package/organization/banner.js.map +1 -0
  35. package/organization/getOrganization.d.ts +10 -63
  36. package/organization/getOrganization.js +6 -47
  37. package/organization/getOrganization.js.map +1 -1
  38. package/organization/index.d.ts +7 -4
  39. package/organization/index.js +11 -6
  40. package/organization/index.js.map +1 -1
  41. package/organization/organization.d.ts +94 -0
  42. package/organization/{settings.js → organization.js} +20 -20
  43. package/organization/organization.js.map +1 -0
  44. package/package.json +2 -3
  45. package/package.json.bak +1 -2
  46. package/pipeline/getPipeline.d.ts +21 -20
  47. package/pipeline/getPipeline.js +8 -14
  48. package/pipeline/getPipeline.js.map +1 -1
  49. package/pipeline/getSignedSteps.d.ts +139 -0
  50. package/pipeline/getSignedSteps.js +91 -0
  51. package/pipeline/getSignedSteps.js.map +1 -0
  52. package/pipeline/getTemplate.d.ts +116 -0
  53. package/pipeline/getTemplate.js +79 -0
  54. package/pipeline/getTemplate.js.map +1 -0
  55. package/pipeline/index.d.ts +12 -0
  56. package/pipeline/index.js +17 -1
  57. package/pipeline/index.js.map +1 -1
  58. package/pipeline/pipeline.d.ts +117 -181
  59. package/pipeline/pipeline.js +15 -113
  60. package/pipeline/pipeline.js.map +1 -1
  61. package/pipeline/schedule.d.ts +57 -45
  62. package/pipeline/schedule.js +22 -19
  63. package/pipeline/schedule.js.map +1 -1
  64. package/pipeline/team.d.ts +137 -0
  65. package/pipeline/team.js +121 -0
  66. package/pipeline/team.js.map +1 -0
  67. package/pipeline/template.d.ts +155 -0
  68. package/pipeline/template.js +123 -0
  69. package/pipeline/template.js.map +1 -0
  70. package/provider.d.ts +26 -8
  71. package/provider.js +2 -0
  72. package/provider.js.map +1 -1
  73. package/team/getTeam.d.ts +39 -30
  74. package/team/getTeam.js +16 -16
  75. package/team/getTeam.js.map +1 -1
  76. package/team/member.d.ts +31 -33
  77. package/team/member.js +20 -22
  78. package/team/member.js.map +1 -1
  79. package/team/team.d.ts +37 -37
  80. package/team/team.js +17 -17
  81. package/testsuite/index.d.ts +6 -0
  82. package/testsuite/index.js +27 -0
  83. package/testsuite/index.js.map +1 -0
  84. package/testsuite/team.d.ts +160 -0
  85. package/testsuite/team.js +144 -0
  86. package/testsuite/team.js.map +1 -0
  87. package/testsuite/testSuite.d.ts +112 -0
  88. package/testsuite/testSuite.js +83 -0
  89. package/testsuite/testSuite.js.map +1 -0
  90. package/types/input.d.ts +37 -22
  91. package/types/output.d.ts +37 -22
  92. package/utilities.d.ts +4 -0
  93. package/utilities.js +33 -1
  94. package/utilities.js.map +1 -1
  95. package/organization/settings.d.ts +0 -78
  96. package/organization/settings.js.map +0 -1
  97. package/scripts/install-pulumi-plugin.js +0 -26
@@ -0,0 +1,137 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ /**
3
+ * Manage team access to a pipeline.
4
+ *
5
+ * ## Example Usage
6
+ *
7
+ * ```typescript
8
+ * import * as pulumi from "@pulumi/pulumi";
9
+ * import * as buildkite from "@pulumiverse/buildkite";
10
+ *
11
+ * const pipeline = new buildkite.pipeline.Pipeline("pipeline", {repository: "https://github.com/..."});
12
+ * const team = new buildkite.team.Team("team", {
13
+ * privacy: "VISIBLE",
14
+ * defaultTeam: false,
15
+ * defaultMemberRole: "MEMBER",
16
+ * });
17
+ * // allow everyone in the "Everyone" team read-only access to pipeline
18
+ * const pipelineTeam = new buildkite.pipeline.Team("pipelineTeam", {
19
+ * pipelineId: pipeline.id,
20
+ * teamId: team.id,
21
+ * accessLevel: "READ_ONLY",
22
+ * });
23
+ * ```
24
+ *
25
+ * ## Import
26
+ *
27
+ * import a pipeline team resource using the GraphQL ID
28
+ *
29
+ * #
30
+ *
31
+ * you can use this query to find the ID:
32
+ *
33
+ * query getPipelineTeamId {
34
+ *
35
+ * pipeline(slug: "ORGANIZATION_SLUG/PIPELINE_SLUG") {
36
+ *
37
+ * teams(first: 5, search: "PIPELINE_SEARCH_TERM") {
38
+ *
39
+ * edges{
40
+ *
41
+ * node{
42
+ *
43
+ * id
44
+ *
45
+ * }
46
+ *
47
+ * }
48
+ *
49
+ * }
50
+ *
51
+ * }
52
+ *
53
+ * }
54
+ *
55
+ * ```sh
56
+ * $ pulumi import buildkite:Pipeline/team:Team guests VGVhbS0tLWU1YjQyMDQyLTUzN2QtNDZjNi04MjY0LTliZjFkMzkyYjZkNQ==
57
+ * ```
58
+ */
59
+ export declare class Team extends pulumi.CustomResource {
60
+ /**
61
+ * Get an existing Team resource's state with the given name, ID, and optional extra
62
+ * properties used to qualify the lookup.
63
+ *
64
+ * @param name The _unique_ name of the resulting resource.
65
+ * @param id The _unique_ provider ID of the resource to lookup.
66
+ * @param state Any extra arguments used during the lookup.
67
+ * @param opts Optional settings to control the behavior of the CustomResource.
68
+ */
69
+ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TeamState, opts?: pulumi.CustomResourceOptions): Team;
70
+ /**
71
+ * Returns true if the given object is an instance of Team. This is designed to work even
72
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
73
+ */
74
+ static isInstance(obj: any): obj is Team;
75
+ /**
76
+ * The access level for the team. Either `READ_ONLY`, `BUILD_AND_READ` or `MANAGE_BUILD_AND_READ`.
77
+ */
78
+ readonly accessLevel: pulumi.Output<string>;
79
+ /**
80
+ * The GraphQL ID of the pipeline.
81
+ */
82
+ readonly pipelineId: pulumi.Output<string>;
83
+ /**
84
+ * The GraphQL ID of the team.
85
+ */
86
+ readonly teamId: pulumi.Output<string>;
87
+ /**
88
+ * The UUID of the pipeline-team relationship.
89
+ */
90
+ readonly uuid: pulumi.Output<string>;
91
+ /**
92
+ * Create a Team resource with the given unique name, arguments, and options.
93
+ *
94
+ * @param name The _unique_ name of the resource.
95
+ * @param args The arguments to use to populate this resource's properties.
96
+ * @param opts A bag of options that control this resource's behavior.
97
+ */
98
+ constructor(name: string, args: TeamArgs, opts?: pulumi.CustomResourceOptions);
99
+ }
100
+ /**
101
+ * Input properties used for looking up and filtering Team resources.
102
+ */
103
+ export interface TeamState {
104
+ /**
105
+ * The access level for the team. Either `READ_ONLY`, `BUILD_AND_READ` or `MANAGE_BUILD_AND_READ`.
106
+ */
107
+ accessLevel?: pulumi.Input<string>;
108
+ /**
109
+ * The GraphQL ID of the pipeline.
110
+ */
111
+ pipelineId?: pulumi.Input<string>;
112
+ /**
113
+ * The GraphQL ID of the team.
114
+ */
115
+ teamId?: pulumi.Input<string>;
116
+ /**
117
+ * The UUID of the pipeline-team relationship.
118
+ */
119
+ uuid?: pulumi.Input<string>;
120
+ }
121
+ /**
122
+ * The set of arguments for constructing a Team resource.
123
+ */
124
+ export interface TeamArgs {
125
+ /**
126
+ * The access level for the team. Either `READ_ONLY`, `BUILD_AND_READ` or `MANAGE_BUILD_AND_READ`.
127
+ */
128
+ accessLevel: pulumi.Input<string>;
129
+ /**
130
+ * The GraphQL ID of the pipeline.
131
+ */
132
+ pipelineId: pulumi.Input<string>;
133
+ /**
134
+ * The GraphQL ID of the team.
135
+ */
136
+ teamId: pulumi.Input<string>;
137
+ }
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
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.Team = void 0;
6
+ const pulumi = require("@pulumi/pulumi");
7
+ const utilities = require("../utilities");
8
+ /**
9
+ * Manage team access to a pipeline.
10
+ *
11
+ * ## Example Usage
12
+ *
13
+ * ```typescript
14
+ * import * as pulumi from "@pulumi/pulumi";
15
+ * import * as buildkite from "@pulumiverse/buildkite";
16
+ *
17
+ * const pipeline = new buildkite.pipeline.Pipeline("pipeline", {repository: "https://github.com/..."});
18
+ * const team = new buildkite.team.Team("team", {
19
+ * privacy: "VISIBLE",
20
+ * defaultTeam: false,
21
+ * defaultMemberRole: "MEMBER",
22
+ * });
23
+ * // allow everyone in the "Everyone" team read-only access to pipeline
24
+ * const pipelineTeam = new buildkite.pipeline.Team("pipelineTeam", {
25
+ * pipelineId: pipeline.id,
26
+ * teamId: team.id,
27
+ * accessLevel: "READ_ONLY",
28
+ * });
29
+ * ```
30
+ *
31
+ * ## Import
32
+ *
33
+ * import a pipeline team resource using the GraphQL ID
34
+ *
35
+ * #
36
+ *
37
+ * you can use this query to find the ID:
38
+ *
39
+ * query getPipelineTeamId {
40
+ *
41
+ * pipeline(slug: "ORGANIZATION_SLUG/PIPELINE_SLUG") {
42
+ *
43
+ * teams(first: 5, search: "PIPELINE_SEARCH_TERM") {
44
+ *
45
+ * edges{
46
+ *
47
+ * node{
48
+ *
49
+ * id
50
+ *
51
+ * }
52
+ *
53
+ * }
54
+ *
55
+ * }
56
+ *
57
+ * }
58
+ *
59
+ * }
60
+ *
61
+ * ```sh
62
+ * $ pulumi import buildkite:Pipeline/team:Team guests VGVhbS0tLWU1YjQyMDQyLTUzN2QtNDZjNi04MjY0LTliZjFkMzkyYjZkNQ==
63
+ * ```
64
+ */
65
+ class Team extends pulumi.CustomResource {
66
+ /**
67
+ * Get an existing Team resource's state with the given name, ID, and optional extra
68
+ * properties used to qualify the lookup.
69
+ *
70
+ * @param name The _unique_ name of the resulting resource.
71
+ * @param id The _unique_ provider ID of the resource to lookup.
72
+ * @param state Any extra arguments used during the lookup.
73
+ * @param opts Optional settings to control the behavior of the CustomResource.
74
+ */
75
+ static get(name, id, state, opts) {
76
+ return new Team(name, state, Object.assign(Object.assign({}, opts), { id: id }));
77
+ }
78
+ /**
79
+ * Returns true if the given object is an instance of Team. This is designed to work even
80
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
81
+ */
82
+ static isInstance(obj) {
83
+ if (obj === undefined || obj === null) {
84
+ return false;
85
+ }
86
+ return obj['__pulumiType'] === Team.__pulumiType;
87
+ }
88
+ constructor(name, argsOrState, opts) {
89
+ let resourceInputs = {};
90
+ opts = opts || {};
91
+ if (opts.id) {
92
+ const state = argsOrState;
93
+ resourceInputs["accessLevel"] = state ? state.accessLevel : undefined;
94
+ resourceInputs["pipelineId"] = state ? state.pipelineId : undefined;
95
+ resourceInputs["teamId"] = state ? state.teamId : undefined;
96
+ resourceInputs["uuid"] = state ? state.uuid : undefined;
97
+ }
98
+ else {
99
+ const args = argsOrState;
100
+ if ((!args || args.accessLevel === undefined) && !opts.urn) {
101
+ throw new Error("Missing required property 'accessLevel'");
102
+ }
103
+ if ((!args || args.pipelineId === undefined) && !opts.urn) {
104
+ throw new Error("Missing required property 'pipelineId'");
105
+ }
106
+ if ((!args || args.teamId === undefined) && !opts.urn) {
107
+ throw new Error("Missing required property 'teamId'");
108
+ }
109
+ resourceInputs["accessLevel"] = args ? args.accessLevel : undefined;
110
+ resourceInputs["pipelineId"] = args ? args.pipelineId : undefined;
111
+ resourceInputs["teamId"] = args ? args.teamId : undefined;
112
+ resourceInputs["uuid"] = undefined /*out*/;
113
+ }
114
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
115
+ super(Team.__pulumiType, name, resourceInputs, opts);
116
+ }
117
+ }
118
+ exports.Team = Team;
119
+ /** @internal */
120
+ Team.__pulumiType = 'buildkite:Pipeline/team:Team';
121
+ //# sourceMappingURL=team.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.js","sourceRoot":"","sources":["../../pipeline/team.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,0CAA0C;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAa,IAAK,SAAQ,MAAM,CAAC,cAAc;IAC3C;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAiB,EAAE,IAAmC;QAC/G,OAAO,IAAI,IAAI,CAAC,IAAI,EAAO,KAAK,kCAAO,IAAI,KAAE,EAAE,EAAE,EAAE,IAAG,CAAC;IAC3D,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,IAAI,CAAC,YAAY,CAAC;IACrD,CAAC;IA2BD,YAAY,IAAY,EAAE,WAAkC,EAAE,IAAmC;QAC7F,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;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C,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;YAClE,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SAC9C;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;;AAhFL,oBAiFC;AAnEG,gBAAgB;AACO,iBAAY,GAAG,8BAA8B,CAAC"}
@@ -0,0 +1,155 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ /**
3
+ * This resource allows for standardized step configurations that can be used within various pipelines of an organization.
4
+ *
5
+ * More information on pipeline templates can be found in the [documentation](https://buildkite.com/docs/pipelines/templates).
6
+ *
7
+ * ## Example Usage
8
+ *
9
+ * ```typescript
10
+ * import * as pulumi from "@pulumi/pulumi";
11
+ * import * as buildkite from "@pulumiverse/buildkite";
12
+ *
13
+ * const templateRequired = new buildkite.pipeline.Template("templateRequired", {configuration: `steps:
14
+ * - label: ":pipeline:"
15
+ * command: "buildkite-agent pipeline upload .buildkite/pipeline-qa.yml"
16
+ *
17
+ * `});
18
+ * const templateFull = new buildkite.pipeline.Template("templateFull", {
19
+ * available: true,
20
+ * configuration: `steps:
21
+ * - label: ":pipeline:"
22
+ * command: "buildkite-agent pipeline upload .buildkite/pipeline-production.yml"
23
+ *
24
+ * `,
25
+ * description: "Production upload template",
26
+ * });
27
+ * ```
28
+ *
29
+ * ## Import
30
+ *
31
+ * import a pipeline template resource using the templates GraphQL ID
32
+ *
33
+ * #
34
+ *
35
+ * You can use this query to find the first 50 templates (adjust for less or more):
36
+ *
37
+ * query getPipelineTemplateIds {
38
+ *
39
+ * organization(slug: "ORGANIZATION_SLUG") {
40
+ *
41
+ * pipelineTemplates(first: 50) {
42
+ *
43
+ * edges{
44
+ *
45
+ * node{
46
+ *
47
+ * id
48
+ *
49
+ * name
50
+ *
51
+ * }
52
+ *
53
+ * }
54
+ *
55
+ * }
56
+ *
57
+ * }
58
+ *
59
+ * }
60
+ *
61
+ * ```sh
62
+ * $ pulumi import buildkite:Pipeline/template:Template template UGlwZWxpbmVUZW1wbGF0ZS0tLWU0YWQ3YjdjLTljZDYtNGM0MS1hYWE0LTY2ZmI3ODY0MTMwNw==
63
+ * ```
64
+ */
65
+ export declare class Template extends pulumi.CustomResource {
66
+ /**
67
+ * Get an existing Template resource's state with the given name, ID, and optional extra
68
+ * properties used to qualify the lookup.
69
+ *
70
+ * @param name The _unique_ name of the resulting resource.
71
+ * @param id The _unique_ provider ID of the resource to lookup.
72
+ * @param state Any extra arguments used during the lookup.
73
+ * @param opts Optional settings to control the behavior of the CustomResource.
74
+ */
75
+ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TemplateState, opts?: pulumi.CustomResourceOptions): Template;
76
+ /**
77
+ * Returns true if the given object is an instance of Template. This is designed to work even
78
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
79
+ */
80
+ static isInstance(obj: any): obj is Template;
81
+ /**
82
+ * If the pipeline template is available for assignment by non admin users.
83
+ */
84
+ readonly available: pulumi.Output<boolean>;
85
+ /**
86
+ * The YAML step configuration for the pipeline template.
87
+ */
88
+ readonly configuration: pulumi.Output<string>;
89
+ /**
90
+ * A description for the pipeline template.
91
+ */
92
+ readonly description: pulumi.Output<string | undefined>;
93
+ /**
94
+ * The name of the pipeline template.
95
+ */
96
+ readonly name: pulumi.Output<string>;
97
+ /**
98
+ * The UUID of the pipeline template.
99
+ */
100
+ readonly uuid: pulumi.Output<string>;
101
+ /**
102
+ * Create a Template resource with the given unique name, arguments, and options.
103
+ *
104
+ * @param name The _unique_ name of the resource.
105
+ * @param args The arguments to use to populate this resource's properties.
106
+ * @param opts A bag of options that control this resource's behavior.
107
+ */
108
+ constructor(name: string, args: TemplateArgs, opts?: pulumi.CustomResourceOptions);
109
+ }
110
+ /**
111
+ * Input properties used for looking up and filtering Template resources.
112
+ */
113
+ export interface TemplateState {
114
+ /**
115
+ * If the pipeline template is available for assignment by non admin users.
116
+ */
117
+ available?: pulumi.Input<boolean>;
118
+ /**
119
+ * The YAML step configuration for the pipeline template.
120
+ */
121
+ configuration?: pulumi.Input<string>;
122
+ /**
123
+ * A description for the pipeline template.
124
+ */
125
+ description?: pulumi.Input<string>;
126
+ /**
127
+ * The name of the pipeline template.
128
+ */
129
+ name?: pulumi.Input<string>;
130
+ /**
131
+ * The UUID of the pipeline template.
132
+ */
133
+ uuid?: pulumi.Input<string>;
134
+ }
135
+ /**
136
+ * The set of arguments for constructing a Template resource.
137
+ */
138
+ export interface TemplateArgs {
139
+ /**
140
+ * If the pipeline template is available for assignment by non admin users.
141
+ */
142
+ available?: pulumi.Input<boolean>;
143
+ /**
144
+ * The YAML step configuration for the pipeline template.
145
+ */
146
+ configuration: pulumi.Input<string>;
147
+ /**
148
+ * A description for the pipeline template.
149
+ */
150
+ description?: pulumi.Input<string>;
151
+ /**
152
+ * The name of the pipeline template.
153
+ */
154
+ name?: pulumi.Input<string>;
155
+ }
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
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.Template = void 0;
6
+ const pulumi = require("@pulumi/pulumi");
7
+ const utilities = require("../utilities");
8
+ /**
9
+ * This resource allows for standardized step configurations that can be used within various pipelines of an organization.
10
+ *
11
+ * More information on pipeline templates can be found in the [documentation](https://buildkite.com/docs/pipelines/templates).
12
+ *
13
+ * ## Example Usage
14
+ *
15
+ * ```typescript
16
+ * import * as pulumi from "@pulumi/pulumi";
17
+ * import * as buildkite from "@pulumiverse/buildkite";
18
+ *
19
+ * const templateRequired = new buildkite.pipeline.Template("templateRequired", {configuration: `steps:
20
+ * - label: ":pipeline:"
21
+ * command: "buildkite-agent pipeline upload .buildkite/pipeline-qa.yml"
22
+ *
23
+ * `});
24
+ * const templateFull = new buildkite.pipeline.Template("templateFull", {
25
+ * available: true,
26
+ * configuration: `steps:
27
+ * - label: ":pipeline:"
28
+ * command: "buildkite-agent pipeline upload .buildkite/pipeline-production.yml"
29
+ *
30
+ * `,
31
+ * description: "Production upload template",
32
+ * });
33
+ * ```
34
+ *
35
+ * ## Import
36
+ *
37
+ * import a pipeline template resource using the templates GraphQL ID
38
+ *
39
+ * #
40
+ *
41
+ * You can use this query to find the first 50 templates (adjust for less or more):
42
+ *
43
+ * query getPipelineTemplateIds {
44
+ *
45
+ * organization(slug: "ORGANIZATION_SLUG") {
46
+ *
47
+ * pipelineTemplates(first: 50) {
48
+ *
49
+ * edges{
50
+ *
51
+ * node{
52
+ *
53
+ * id
54
+ *
55
+ * name
56
+ *
57
+ * }
58
+ *
59
+ * }
60
+ *
61
+ * }
62
+ *
63
+ * }
64
+ *
65
+ * }
66
+ *
67
+ * ```sh
68
+ * $ pulumi import buildkite:Pipeline/template:Template template UGlwZWxpbmVUZW1wbGF0ZS0tLWU0YWQ3YjdjLTljZDYtNGM0MS1hYWE0LTY2ZmI3ODY0MTMwNw==
69
+ * ```
70
+ */
71
+ class Template extends pulumi.CustomResource {
72
+ /**
73
+ * Get an existing Template resource's state with the given name, ID, and optional extra
74
+ * properties used to qualify the lookup.
75
+ *
76
+ * @param name The _unique_ name of the resulting resource.
77
+ * @param id The _unique_ provider ID of the resource to lookup.
78
+ * @param state Any extra arguments used during the lookup.
79
+ * @param opts Optional settings to control the behavior of the CustomResource.
80
+ */
81
+ static get(name, id, state, opts) {
82
+ return new Template(name, state, Object.assign(Object.assign({}, opts), { id: id }));
83
+ }
84
+ /**
85
+ * Returns true if the given object is an instance of Template. This is designed to work even
86
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
87
+ */
88
+ static isInstance(obj) {
89
+ if (obj === undefined || obj === null) {
90
+ return false;
91
+ }
92
+ return obj['__pulumiType'] === Template.__pulumiType;
93
+ }
94
+ constructor(name, argsOrState, opts) {
95
+ let resourceInputs = {};
96
+ opts = opts || {};
97
+ if (opts.id) {
98
+ const state = argsOrState;
99
+ resourceInputs["available"] = state ? state.available : undefined;
100
+ resourceInputs["configuration"] = state ? state.configuration : undefined;
101
+ resourceInputs["description"] = state ? state.description : undefined;
102
+ resourceInputs["name"] = state ? state.name : undefined;
103
+ resourceInputs["uuid"] = state ? state.uuid : undefined;
104
+ }
105
+ else {
106
+ const args = argsOrState;
107
+ if ((!args || args.configuration === undefined) && !opts.urn) {
108
+ throw new Error("Missing required property 'configuration'");
109
+ }
110
+ resourceInputs["available"] = args ? args.available : undefined;
111
+ resourceInputs["configuration"] = args ? args.configuration : undefined;
112
+ resourceInputs["description"] = args ? args.description : undefined;
113
+ resourceInputs["name"] = args ? args.name : undefined;
114
+ resourceInputs["uuid"] = undefined /*out*/;
115
+ }
116
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
117
+ super(Template.__pulumiType, name, resourceInputs, opts);
118
+ }
119
+ }
120
+ exports.Template = Template;
121
+ /** @internal */
122
+ Template.__pulumiType = 'buildkite:Pipeline/template:Template';
123
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../pipeline/template.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,0CAA0C;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,MAAa,QAAS,SAAQ,MAAM,CAAC,cAAc;IAC/C;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAqB,EAAE,IAAmC;QACnH,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MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;aAChE;YACD,cAAc,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;YAChE,cAAc,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;YACxE,cAAc,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;YACpE,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YACtD,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SAC9C;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;;AAhFL,4BAiFC;AAnEG,gBAAgB;AACO,qBAAY,GAAG,sCAAsC,CAAC"}
package/provider.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
+ import * as inputs from "./types/input";
2
3
  /**
3
4
  * The provider type for the buildkite package. By default, resources use package-wide configuration
4
5
  * settings, however an explicit `Provider` instance may be created and passed during resource
@@ -12,19 +13,25 @@ export declare class Provider extends pulumi.ProviderResource {
12
13
  */
13
14
  static isInstance(obj: any): obj is Provider;
14
15
  /**
15
- * API token with GraphQL access and `write_pipelines, read_pipelines` scopes
16
+ * API token with GraphQL access and `write_pipelines`, `read_pipelines` and `write_suites` REST API scopes. You can
17
+ * generate a token from [your settings
18
+ * page](https://buildkite.com/user/api-access-tokens/new?description=terraform&scopes[]=write_pipelines&scopes[]=write_suites&scopes[]=read_pipelines&scopes[]=graphql).
19
+ * If not provided, the value is taken from the `BUILDKITE_API_TOKEN` environment variable.
16
20
  */
17
21
  readonly apiToken: pulumi.Output<string | undefined>;
18
22
  /**
19
- * Base URL for the GraphQL API to use
23
+ * Base URL for the GraphQL API to use. If not provided, the value is taken from the `BUILDKITE_GRAPHQL_URL` environment
24
+ * variable.
20
25
  */
21
26
  readonly graphqlUrl: pulumi.Output<string | undefined>;
22
27
  /**
23
- * The Buildkite organization slug
28
+ * The Buildkite organization slug. This can be found on the [settings](https://buildkite.com/organizations/~/settings)
29
+ * page. If not provided, the value is taken from the `BUILDKITE_ORGANIZATION_SLUG` environment variable.
24
30
  */
25
31
  readonly organization: pulumi.Output<string | undefined>;
26
32
  /**
27
- * Base URL for the REST API to use
33
+ * Base URL for the REST API to use. If not provided, the value is taken from the `BUILDKITE_REST_URL` environment
34
+ * variable.
28
35
  */
29
36
  readonly restUrl: pulumi.Output<string | undefined>;
30
37
  /**
@@ -41,19 +48,30 @@ export declare class Provider extends pulumi.ProviderResource {
41
48
  */
42
49
  export interface ProviderArgs {
43
50
  /**
44
- * API token with GraphQL access and `write_pipelines, read_pipelines` scopes
51
+ * API token with GraphQL access and `write_pipelines`, `read_pipelines` and `write_suites` REST API scopes. You can
52
+ * generate a token from [your settings
53
+ * page](https://buildkite.com/user/api-access-tokens/new?description=terraform&scopes[]=write_pipelines&scopes[]=write_suites&scopes[]=read_pipelines&scopes[]=graphql).
54
+ * If not provided, the value is taken from the `BUILDKITE_API_TOKEN` environment variable.
45
55
  */
46
56
  apiToken?: pulumi.Input<string>;
47
57
  /**
48
- * Base URL for the GraphQL API to use
58
+ * Enable this to archive pipelines when destroying the resource. This is opposed to completely deleting pipelines.
59
+ */
60
+ archivePipelineOnDelete?: pulumi.Input<boolean>;
61
+ /**
62
+ * Base URL for the GraphQL API to use. If not provided, the value is taken from the `BUILDKITE_GRAPHQL_URL` environment
63
+ * variable.
49
64
  */
50
65
  graphqlUrl?: pulumi.Input<string>;
51
66
  /**
52
- * The Buildkite organization slug
67
+ * The Buildkite organization slug. This can be found on the [settings](https://buildkite.com/organizations/~/settings)
68
+ * page. If not provided, the value is taken from the `BUILDKITE_ORGANIZATION_SLUG` environment variable.
53
69
  */
54
70
  organization?: pulumi.Input<string>;
55
71
  /**
56
- * Base URL for the REST API to use
72
+ * Base URL for the REST API to use. If not provided, the value is taken from the `BUILDKITE_REST_URL` environment
73
+ * variable.
57
74
  */
58
75
  restUrl?: pulumi.Input<string>;
76
+ timeouts?: pulumi.Input<inputs.ProviderTimeouts>;
59
77
  }
package/provider.js CHANGED
@@ -34,9 +34,11 @@ class Provider extends pulumi.ProviderResource {
34
34
  opts = opts || {};
35
35
  {
36
36
  resourceInputs["apiToken"] = (args === null || args === void 0 ? void 0 : args.apiToken) ? pulumi.secret(args.apiToken) : undefined;
37
+ resourceInputs["archivePipelineOnDelete"] = pulumi.output(args ? args.archivePipelineOnDelete : undefined).apply(JSON.stringify);
37
38
  resourceInputs["graphqlUrl"] = args ? args.graphqlUrl : undefined;
38
39
  resourceInputs["organization"] = args ? args.organization : undefined;
39
40
  resourceInputs["restUrl"] = args ? args.restUrl : undefined;
41
+ resourceInputs["timeouts"] = pulumi.output(args ? args.timeouts : undefined).apply(JSON.stringify);
40
42
  }
41
43
  opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
42
44
  const secretOpts = { additionalSecretOutputs: ["apiToken"] };
package/provider.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../provider.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;GAKG;AACH,MAAa,QAAS,SAAQ,MAAM,CAAC,gBAAgB;IAIjD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KA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