-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added resource for bitbucket datacenter integration handling (#498)
* Bump google.golang.org/grpc from 1.57.0 to 1.57.1 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.57.0 to 1.57.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.57.0...v1.57.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * Added resource for bitbucket datacenter integration handling * Minor improvements * Adjust bitbucket datacenter resource to recent changes --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Plushnikov, Michail <[email protected]> Co-authored-by: Piotr Truszkowski <[email protected]>
- Loading branch information
1 parent
702e125
commit 4e1dd29
Showing
15 changed files
with
549 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "spacelift_bitbucket_datacenter_integration Resource - terraform-provider-spacelift" | ||
subcategory: "" | ||
description: |- | ||
spacelift_bitbucket_datacenter_integration represents details of a bitbucket datacenter integration | ||
--- | ||
|
||
# spacelift_bitbucket_datacenter_integration (Resource) | ||
|
||
`spacelift_bitbucket_datacenter_integration` represents details of a bitbucket datacenter integration | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
# When a Bitbucket Datacenter server is accessible from the public internet. | ||
resource "spacelift_bitbucket_datacenter_integration" "example" { | ||
name = "Bitbucket integration" | ||
is_default = false | ||
space_id = "root" | ||
api_host = "https://mybitbucket.myorg.com" | ||
user_facing_host = "https://mybitbucket.myorg.com" | ||
username = "bitbucket_user_name" | ||
access_token = "ABCD-EFGhiJKlMNoPQrSTuVWxYz0123456789abCDefGhiJkL" | ||
} | ||
# When a Bitbucket Datacenter server is not accessible from the public internet. | ||
# We need to use "private://" scheme to reach out our VCS Agent pool. | ||
resource "spacelift_bitbucket_datacenter_integration" "private-example" { | ||
name = "Bitbucket integration" | ||
is_default = false | ||
space_id = "root" | ||
api_host = "private://mybitbucket" | ||
user_facing_host = "https://mybitbucket.myorg.com" | ||
username = "bitbucket_user_name" | ||
access_token = "ABCD-EFGhiJKlMNoPQrSTuVWxYz0123456789abCDefGhiJkL" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `access_token` (String, Sensitive) User access token from Bitbucket | ||
- `api_host` (String) The API host where requests will be sent | ||
- `is_default` (Boolean) Bitbucket Datacenter integration is default. | ||
- `name` (String) Bitbucket Datacenter integration name | ||
- `user_facing_host` (String) User Facing Host which will be used for all user-facing URLs displayed in the Spacelift UI | ||
- `username` (String) Username which will be used to authenticate requests for cloning repositories | ||
|
||
### Optional | ||
|
||
- `description` (String) Bitbucket Datacenter integration description | ||
- `labels` (Set of String) Bitbucket Datacenter integration labels | ||
- `space_id` (String) Bitbucket Datacenter integration space id. Defaults to `root`. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Bitbucket Datacenter integration id. | ||
- `webhook_secret` (String, Sensitive) Secret for webhooks originating from Bitbucket repositories | ||
- `webhook_url` (String) URL for webhooks originating from Bitbucket repositories | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import spacelift_bitbucket_datacenter_integration.example spacelift_bitbucket_datacenter_integration_id | ||
``` |
1 change: 1 addition & 0 deletions
1
examples/resources/spacelift_bitbucket_datacenter_integration/import.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import spacelift_bitbucket_datacenter_integration.example spacelift_bitbucket_datacenter_integration_id |
22 changes: 22 additions & 0 deletions
22
examples/resources/spacelift_bitbucket_datacenter_integration/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# When a Bitbucket Datacenter server is accessible from the public internet. | ||
resource "spacelift_bitbucket_datacenter_integration" "example" { | ||
name = "Bitbucket integration" | ||
is_default = false | ||
space_id = "root" | ||
api_host = "https://mybitbucket.myorg.com" | ||
user_facing_host = "https://mybitbucket.myorg.com" | ||
username = "bitbucket_user_name" | ||
access_token = "ABCD-EFGhiJKlMNoPQrSTuVWxYz0123456789abCDefGhiJkL" | ||
} | ||
|
||
# When a Bitbucket Datacenter server is not accessible from the public internet. | ||
# We need to use "private://" scheme to reach out our VCS Agent pool. | ||
resource "spacelift_bitbucket_datacenter_integration" "private-example" { | ||
name = "Bitbucket integration" | ||
is_default = false | ||
space_id = "root" | ||
api_host = "private://mybitbucket" | ||
user_facing_host = "https://mybitbucket.myorg.com" | ||
username = "bitbucket_user_name" | ||
access_token = "ABCD-EFGhiJKlMNoPQrSTuVWxYz0123456789abCDefGhiJkL" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
spacelift/internal/structs/bitbucket_datacenter_integration.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package structs | ||
|
||
import "github.com/shurcooL/graphql" | ||
|
||
// BitbucketDatacenterIntegration represents the bitbucket datacenter integration data relevant to the provider. | ||
type BitbucketDatacenterIntegration struct { | ||
ID string `graphql:"id"` | ||
Name string `graphql:"name"` | ||
IsDefault bool `graphql:"isDefault"` | ||
Space struct { | ||
ID string `graphql:"id"` | ||
} `graphql:"space"` | ||
Labels []string `graphql:"labels"` | ||
Description *string `graphql:"description"` | ||
APIHost string `graphql:"apiHost"` | ||
Username string `graphql:"username"` | ||
UserFacingHost string `graphql:"userFacingHost"` | ||
WebhookSecret string `graphql:"webhookSecret"` | ||
WebhookURL string `graphql:"webhookURL"` | ||
} | ||
|
||
// CustomVCSInput represents the custom VCS input data. | ||
type CustomVCSInput struct { | ||
Name graphql.String `json:"name"` | ||
SpaceID graphql.ID `json:"spaceID"` | ||
Labels *[]graphql.String `json:"labels"` | ||
Description *graphql.String `json:"description"` | ||
IsDefault *graphql.Boolean `json:"isDefault"` | ||
} | ||
|
||
// CustomVCSUpdateInput represents the custom VCS update input data. | ||
type CustomVCSUpdateInput struct { | ||
ID graphql.ID `json:"id"` | ||
SpaceID graphql.ID `json:"space"` | ||
Labels *[]graphql.String `json:"labels"` | ||
Description *graphql.String `json:"description"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.