Skip to content

Commit 6e252db

Browse files
authored
Updated provider documentation (#28)
* update documentation with realistic examples * cleanup from scaffolding template repo prior to release * add CHANGELOG.md and CONTRIBUTING.md
1 parent 47eef16 commit 6e252db

File tree

40 files changed

+1223
-1117
lines changed

40 files changed

+1223
-1117
lines changed

CHANGELOG.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1-
## 0.1.0 (Unreleased)
1+
## 0.1.0
2+
3+
Initial release of the Terraform Keycard Provider.
24

35
FEATURES:
6+
7+
* **New Provider**: Terraform provider for managing Keycard resources
8+
* **OAuth2 Authentication**: Full support for OAuth2 client credentials flow with automatic token refresh
9+
* **Zone Management**: Create and manage Keycard zones with OAuth2 configuration
10+
* **Application Management**: Full lifecycle management of applications and their configurations
11+
* **Identity Provider Integration**: Configure and manage identity providers and user identity mappings
12+
* **Resource Protection**: Define and manage protected resources within your zones
13+
* **Workload Identity Federation**: Support for workload identity with JWT and OIDC configurations
14+
* **Access Management**: Configure application dependencies and access grants
15+
* **Comprehensive Data Sources**: Read-only access to all managed resources for data lookups
16+
17+
RESOURCES:
18+
19+
* `keycard_zone` - Manage Keycard zones
20+
* `keycard_provider` - Configure identity and credential providers
21+
* `keycard_zone_user_identity_config` - Link user identities to zones
22+
* `keycard_application` - Manage applications
23+
* `keycard_application_client_secret` - Manage OAuth2 client credentials
24+
* `keycard_application_workload_identity` - Configure workload identity federation
25+
* `keycard_resource` - Define protected resources
26+
* `keycard_application_dependency` - Configure application access grants
27+
28+
DATA SOURCES:
29+
30+
* `keycard_zone` - Look up zone information
31+
* `keycard_provider` - Look up provider configurations
32+
* `keycard_zone_user_identity_config` - Look up identity configurations
33+
* `keycard_application` - Look up application details
34+
* `keycard_application_workload_identity` - Look up workload identity configurations
35+
* `keycard_resource` - Look up resource definitions
36+
37+
DOCUMENTATION:
38+
39+
* Complete provider and resource documentation
40+
* Okta integration guide with step-by-step instructions
41+
* Examples for all resources and common use cases

CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contributing to Terraform Keycard Provider
2+
3+
Thank you for your interest in the Terraform Keycard Provider!
4+
5+
## Contribution Policy
6+
7+
**We do not accept external contributions at this time.**
8+
9+
This provider is maintained by the Keycard team and we handle all development internally to ensure consistency with our platform and roadmap.
10+
11+
## Reporting Issues
12+
13+
If you encounter a bug or have a feature request, please open an issue on our [GitHub Issues](https://github.com/keycardai/terraform-provider-keycard/issues) page. When reporting issues, please include:
14+
15+
- Terraform version (`terraform version`)
16+
- Provider version
17+
- Relevant configuration snippets (sanitized of sensitive data)
18+
- Expected behavior vs. actual behavior
19+
- Steps to reproduce
20+
21+
## Getting Support
22+
23+
For questions, support, or general inquiries:
24+
25+
- Review the [provider documentation](https://registry.terraform.io/providers/keycardai/keycard/latest/docs)
26+
- Check existing [GitHub Issues](https://github.com/keycardai/terraform-provider-keycard/issues)
27+
- Contact Keycard support through your regular support channels
28+
29+
## Development
30+
31+
This provider is built using the [Terraform Plugin Framework](https://developer.hashicorp.com/terraform/plugin/framework).
32+
33+
For information on local development and testing, see the [README.md](README.md#local-development-installation).
34+
35+
## License
36+
37+
This provider is licensed under the [Mozilla Public License 2.0](LICENSE).

LICENSE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
Copyright (c) 2021 HashiCorp, Inc.
2-
31
Mozilla Public License Version 2.0
42
==================================
53

docs/data-sources/application.md

Lines changed: 9 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -13,72 +13,17 @@ Reads a Keycard application. An application is a software system with an associa
1313
## Example Usage
1414

1515
```terraform
16-
# Fetch an existing application by zone_id and id
17-
data "keycard_application" "by_id" {
18-
zone_id = "etx6ju28wu5ibs3shgxqwwwpw0"
19-
id = "app123456789"
16+
# Look up an existing application by zone_id and id
17+
# Useful when you need to reference applications created outside Terraform
18+
data "keycard_application" "google_mcp" {
19+
zone_id = keycard_zone.production.id
20+
id = var.google_mcp_server_id
2021
}
2122
22-
# Fetch an existing application by zone_id and identifier
23-
data "keycard_application" "by_identifier" {
24-
zone_id = "etx6ju28wu5ibs3shgxqwwwpw0"
25-
identifier = "https://app.example.com"
26-
}
27-
28-
# Output the application details
29-
output "application_name" {
30-
value = data.keycard_application.by_id.name
31-
}
32-
33-
output "application_identifier" {
34-
value = data.keycard_application.by_id.identifier
35-
}
36-
37-
output "application_description" {
38-
value = data.keycard_application.by_id.description
39-
}
40-
41-
output "application_metadata" {
42-
value = data.keycard_application.by_id.metadata
43-
}
44-
45-
output "application_oauth2_redirect_uris" {
46-
value = data.keycard_application.by_id.oauth2.redirect_uris
47-
}
48-
49-
# Use with an application resource
50-
resource "keycard_zone" "production" {
51-
name = "production"
52-
}
53-
54-
resource "keycard_application" "web_app" {
55-
zone_id = keycard_zone.production.id
56-
name = "Web Application"
57-
description = "Main production web application"
58-
identifier = "https://app.example.com"
59-
60-
metadata = {
61-
docs_url = "https://docs.example.com/web-app"
62-
}
63-
64-
oauth2 = {
65-
redirect_uris = [
66-
"https://app.example.com/auth/callback",
67-
"https://app.example.com/oauth2/callback"
68-
]
69-
}
70-
}
71-
72-
# Lookup by ID
73-
data "keycard_application" "lookup_by_id" {
74-
zone_id = keycard_application.web_app.zone_id
75-
id = keycard_application.web_app.id
76-
}
77-
78-
# Lookup by identifier
79-
data "keycard_application" "lookup_by_identifier" {
80-
zone_id = keycard_application.web_app.zone_id
81-
identifier = keycard_application.web_app.identifier
23+
# Use the data source to create client credentials for local development
24+
resource "keycard_application_client_secret" "local_dev" {
25+
zone_id = keycard_zone.production.id
26+
application_id = data.keycard_application.google_mcp.id
8227
}
8328
```
8429

docs/data-sources/application_workload_identity.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,17 @@ Reads a workload identity credential for a Keycard application. This allows you
1313
## Example Usage
1414

1515
```terraform
16-
# Fetch an existing workload identity credential
17-
data "keycard_application_workload_identity" "example" {
18-
zone_id = "zone-abc123"
19-
id = "cred-xyz789"
16+
# Look up an existing workload identity by zone_id and id
17+
# Useful for referencing workload identities credentials created outside Terraform
18+
data "keycard_application_workload_identity" "okta_mcp" {
19+
zone_id = keycard_zone.production.id
20+
id = var.keycard_workload_identity_id
2021
}
2122
22-
# Use the data source outputs
23-
output "workload_identity_subject" {
24-
value = data.keycard_application_workload_identity.example.subject
25-
description = "The subject constraint for this workload identity"
26-
}
27-
28-
output "workload_identity_provider" {
29-
value = data.keycard_application_workload_identity.example.provider_id
30-
description = "The provider that validates tokens"
23+
# Use the data source to verify configuration
24+
output "mcp_service_account_subject" {
25+
value = data.keycard_application_workload_identity.okta_mcp.subject
26+
description = "Kubernetes service account subject for Okta MCP server"
3127
}
3228
```
3329

docs/data-sources/provider.md

Lines changed: 16 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -13,83 +13,24 @@ Reads a Keycard provider. A provider is a system that supplies access to resourc
1313
## Example Usage
1414

1515
```terraform
16-
# Fetch an existing provider by zone_id and id
17-
data "keycard_provider" "by_id" {
18-
zone_id = "etx6ju28wu5ibs3shgxqwwwpw0"
19-
id = "4rte3f0v5mkr3htgkp2glkrg00"
20-
}
21-
22-
# Fetch an existing provider by zone_id and identifier
23-
data "keycard_provider" "by_identifier" {
24-
zone_id = "etx6ju28wu5ibs3shgxqwwwpw0"
25-
identifier = "https://dev-123456.okta.com"
26-
}
27-
28-
# Fetch the default STS Provider for a Zone
29-
resource "keycard_zone" "example" {
30-
name = "Example Zone"
31-
}
32-
33-
data "keycard_provider" "sts" {
34-
zone_id = keycard_zone.example.id
35-
identifier = keycard_zone.example.oauth2.issuer_url
36-
}
37-
38-
# Output the provider details
39-
output "provider_name" {
40-
value = data.keycard_provider.by_id.name
41-
}
42-
43-
output "provider_identifier" {
44-
value = data.keycard_provider.by_id.identifier
45-
}
46-
47-
output "provider_description" {
48-
value = data.keycard_provider.by_id.description
49-
}
50-
51-
output "provider_client_id" {
52-
value = data.keycard_provider.by_id.client_id
53-
}
54-
55-
output "provider_oauth2_endpoints" {
56-
value = {
57-
authorization_endpoint = data.keycard_provider.by_id.oauth2.authorization_endpoint
58-
token_endpoint = data.keycard_provider.by_id.oauth2.token_endpoint
16+
# Look up an existing provider by zone_id and identifier
17+
# Useful for referencing providers created outside Terraform or by other teams
18+
data "keycard_provider" "google" {
19+
zone_id = keycard_zone.production.id
20+
identifier = "https://accounts.google.com"
21+
}
22+
23+
# Use the provider in resource configurations
24+
resource "keycard_resource" "google_photos" {
25+
name = "Google Photos"
26+
identifier = "https://www.googleapis.com/photos/v1"
27+
zone_id = keycard_zone.production.id
28+
credential_provider_id = data.keycard_provider.google.id
29+
30+
oauth2 = {
31+
scopes = ["https://www.googleapis.com/auth/photoslibrary"]
5932
}
6033
}
61-
62-
# Output STS Provider details
63-
output "sts_provider_name" {
64-
value = data.keycard_provider.sts.name
65-
}
66-
67-
output "sts_provider_identifier" {
68-
value = data.keycard_provider.sts.identifier
69-
description = "The STS issuer URL"
70-
}
71-
72-
# Use with a provider resource
73-
resource "keycard_provider" "okta" {
74-
zone_id = "etx6ju28wu5ibs3shgxqwwwpw0"
75-
name = "Okta"
76-
description = "Okta provider for user authentication"
77-
identifier = "https://dev-123456.okta.com"
78-
client_id = "okta-client-id"
79-
client_secret = "okta-client-secret"
80-
}
81-
82-
# Lookup by ID
83-
data "keycard_provider" "lookup_by_id" {
84-
zone_id = keycard_provider.okta.zone_id
85-
id = keycard_provider.okta.id
86-
}
87-
88-
# Lookup by identifier
89-
data "keycard_provider" "lookup_by_identifier" {
90-
zone_id = keycard_provider.okta.zone_id
91-
identifier = keycard_provider.okta.identifier
92-
}
9334
```
9435

9536
<!-- schema generated by tfplugindocs -->

0 commit comments

Comments
 (0)