-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Azure Service Principal to Framework (#168)
* Migrate Azure Service Principal resource to Framework * Set scope to be Optional * Use docs generation for Vault Approle
- Loading branch information
Showing
13 changed files
with
370 additions
and
325 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,41 @@ | ||
# jenkins_credential_vault_approle Data Source | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "jenkins_credential_vault_approle Data Source - terraform-provider-jenkins" | ||
subcategory: "" | ||
description: |- | ||
Get the attributes of a vault approle credential within Jenkins. | ||
--- | ||
|
||
Get the attributes of a Vault AppRole credential within Jenkins. | ||
# jenkins_credential_vault_approle (Data Source) | ||
|
||
~> The Jenkins installation that uses this resource is expected to have the [Hashicorp Vault Plugin](https://plugins.jenkins.io/hashicorp-vault-plugin/) installed in their system. | ||
Get the attributes of a vault approle credential within Jenkins. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
```terraform | ||
data "jenkins_credential_vault_approle" "example" { | ||
name = "job-name" | ||
name = "name" | ||
folder = jenkins_folder.example.id | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
The following arguments are supported: | ||
### Required | ||
|
||
* `name` - (Required) The name of the resource being read. | ||
* `domain` - (Optional) The domain store to place the credentials into. If not set will default to the global credentials store. | ||
* `folder` - (Optional) The folder namespace containing this resource. | ||
- `name` (String) The name of the resource being read. | ||
|
||
## Attribute Reference | ||
### Optional | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
- `domain` (String) The domain store containing this resource. | ||
- `folder` (String) The folder namespace containing this resource. | ||
|
||
* `id` - The full canonical job path, E.G. `/job/job-name`. | ||
* `description` - A human readable description of the credentials being stored. | ||
* `scope` - The visibility of the credentials to Jenkins agents. This must be set to either "GLOBAL" or "SYSTEM". | ||
* `namespace` - The Vault namespace of the approle credential. | ||
* `path` - The unique name of the approle auth backend. Defaults to `approle`. | ||
* `role_id` - The role_id to be associated with the credentials. | ||
### Read-Only | ||
|
||
- `description` (String) A human readable description of the credentials being stored. | ||
- `id` (String) The full canonical job path, e.g. `/job/job-name` | ||
- `namespace` (String) The Vault namespace of the approle credential. | ||
- `path` (String) The unique name of the approle auth backend. | ||
- `role_id` (String) The role_id associated with the credentials. | ||
- `scope` (String) The visibility of the credentials to Jenkins agents. This will be either "GLOBAL" or "SYSTEM". |
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
7 changes: 7 additions & 0 deletions
7
examples/resources/jenkins_credential_azure_service_principal/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,7 @@ | ||
resource "jenkins_credential_azure_service_principal" "foo" { | ||
name = "example-secret" | ||
subscription_id = "01234567-89ab-cdef-0123-456789abcdef" | ||
client_id = "abcdef01-2345-6789-0123-456789abcdef" | ||
client_secret = "super-secret" | ||
tenant = "01234567-89ab-cdef-abcd-456789abcdef" | ||
} |
21 changes: 13 additions & 8 deletions
21
integration/credentials/credentials_azure_service_principal.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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
resource "jenkins_credential_azure_service_principal" "azure_service_principal_test_credential" { | ||
name = "bla" | ||
folder = jenkins_folder.example.id | ||
description = "blabla" | ||
subscription_id = "123" | ||
client_id = "123" | ||
client_secret = "super-secret" | ||
tenant = "456" | ||
resource "jenkins_credential_azure_service_principal" "azure_service_principal_test_credential" { | ||
name = "bla" | ||
folder = jenkins_folder.example.id | ||
description = "blabla" | ||
subscription_id = "123" | ||
client_id = "123" | ||
client_secret = "super-secret" | ||
tenant = "456" | ||
} | ||
|
||
output "azure_service_principal" { | ||
value = jenkins_credential_azure_service_principal.azure_service_principal_test_credential | ||
sensitive = true | ||
} |
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
Oops, something went wrong.