Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #123 from symopsio/leslie/sym-3944-update-tf-regis…
Browse files Browse the repository at this point in the history
…try-flow-params-docs-with

[SYM-3944] Update registry docs to link to main docs Flow Params page.
  • Loading branch information
llam15 authored Jul 20, 2022
2 parents 37db145 + 3fa8003 commit 37e7594
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 47 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The sym terraform provider is released with the following steps:
* The CI build produces artifacts and uploads them via `goreleaser`
* The CI build syncs the directory to s3

At this point, the registry will be able to provide the new release - check out the [repo](https://github.com/symopsio/terraform-registry) for more details about how the provider is served to users.
At this point, the new release should be available in the [Public Terraform Registry](https://registry.terraform.io/providers/symopsio/sym/latest)

## Development

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_approvers(request):
- `environment_id` (String) The ID of the Environment this Flow is associated with.
- `implementation` (String) Relative path of the implementation file written in python.
- `name` (String) A unique identifier for the Flow.
- `params` (Map of String) A set of parameters, as defined by the Template, which configure the Flow. See the documentation for your specific Template for more details.
- `params` (Map of String) A set of parameters which configure the Flow. See the [Sym Documentation](https://docs.symops.com/docs/flow-parameters).
- `template` (String) The SRN of the template this flow uses. E.g. 'sym:template:approval:1.0.0'

### Optional
Expand Down
90 changes: 68 additions & 22 deletions docs/resources/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,105 @@ The `sym_integration` resource allows you to provide Sym with the credentials an
## Example Usage

```terraform
# pagerduty integration
resource "sym_integration" "pagerduty" {
type = "pagerduty"
name = "prod-pagerduty"
# Aptible integration
resource "sym_integration" "aptible" {
type = "aptible"
name = "main-aptible"
external_id = "mycompany.pagerduty.com"
# Your Aptible Organization ID
external_id = "94a49e57-d046-4d9d-9dbf-f7711e337368"
settings = {
api_token_secret = "xxx"
# `type=aptible` sym_integrations have required settings `username_secret` and `password_secret`,
# which must point to sym_secrets referencing your Aptible bot credentials
# e.g. `sym_secret.aptible_bot_username.id` and `sym_secret.aptible_bot_password.id`
username_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
password_secret = "cb3316e2-8612-4f44-9c11-de82c5a7d618"
}
}
# slack integration
resource "sym_integration" "slack" {
type = "slack"
name = "prod-workspace"
# GitHub integration
resource "sym_integration" "github" {
type = "github"
name = "main-okta-integration"
external_id = "T1234567"
# GitHub Organization name
external_id = "my-github-org"
settings = {
# `type=github` sym_integrations have a required setting `api_token_secret`,
# which must point to a sym_secret referencing your Github API Key
# e.g. `sym_secret.github_api_key.id`
api_token_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
}
}
# okta integration
# Okta integration
resource "sym_integration" "okta" {
type = "okta"
name = "main-okta-integration"
# Okta Domain
external_id = "dev-12345.okta.com"
settings = {
# `type=okta` sym_integrations have a required setting `api_token_secret`,
# which must point to a sym_secret referencing your Okta API Key
api_token_secret = "xxx12345abcde"
# e.g. `sym_secret.okta_api_key.id`
api_token_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
}
}
# github integration
resource "sym_integration" "github" {
type = "github"
name = "main-okta-integration"
external_id = "my-github-org" # github org slug
# PagerDuty integration
resource "sym_integration" "pagerduty" {
type = "pagerduty"
name = "prod-pagerduty"
# PagerDuty domain
external_id = "mycompany.pagerduty.com"
settings = {
# `type=github` sym_integrations have a required setting `api_token_secret`,
# which must point to a sym_secret referencing your Github API Key
api_token_secret = "xxx12345abcde"
# `type=pagerduty` sym_integrations have a required setting `api_token_secret`,
# which must point to a sym_secret referencing your PagerDuty API Key
# e.g. `sym_secret.pagerduty_api_key.id`
api_token_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
}
}
# Segment Integration
resource "sym_integration" "segment" {
type = "segment"
name = "main-segment-integration"
# Your Segment Workspace name
external_id = "sym-test"
settings = {
# `type=segment` sym_integrations have a required setting `write_key_secret`,
# which must point to a sym_secret referencing your Segment Write Key
# e.g. `sym_secret.segment_write_key.id`
api_token_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
}
}
# runtime permission context integration
# Slack integration
resource "sym_integration" "slack" {
type = "slack"
name = "prod-workspace"
# Slack Workspace ID
external_id = "T1234567"
}
# Runtime Permission Context integration
resource "sym_integration" "runtime_context" {
type = "permission_context"
name = "aws-flow-context-test"
label = "Runtime context"
external_id = "123456789012"
# These settings will often be set to the output of a connector module (e.g. runtime-connector)
settings = {
cloud = "aws"
external_id = "1478F2AD-6091-41E6-B3D2-766CA2F173CB" # optional
Expand Down
90 changes: 68 additions & 22 deletions examples/resources/sym_integration/resource.tf
Original file line number Diff line number Diff line change
@@ -1,56 +1,102 @@
# pagerduty integration
resource "sym_integration" "pagerduty" {
type = "pagerduty"
name = "prod-pagerduty"
# Aptible integration
resource "sym_integration" "aptible" {
type = "aptible"
name = "main-aptible"

external_id = "mycompany.pagerduty.com"
# Your Aptible Organization ID
external_id = "94a49e57-d046-4d9d-9dbf-f7711e337368"

settings = {
api_token_secret = "xxx"
# `type=aptible` sym_integrations have required settings `username_secret` and `password_secret`,
# which must point to sym_secrets referencing your Aptible bot credentials
# e.g. `sym_secret.aptible_bot_username.id` and `sym_secret.aptible_bot_password.id`
username_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
password_secret = "cb3316e2-8612-4f44-9c11-de82c5a7d618"
}
}

# slack integration
resource "sym_integration" "slack" {
type = "slack"
name = "prod-workspace"
# GitHub integration
resource "sym_integration" "github" {
type = "github"
name = "main-okta-integration"

external_id = "T1234567"
# GitHub Organization name
external_id = "my-github-org"

settings = {
# `type=github` sym_integrations have a required setting `api_token_secret`,
# which must point to a sym_secret referencing your Github API Key
# e.g. `sym_secret.github_api_key.id`
api_token_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
}
}

# okta integration
# Okta integration
resource "sym_integration" "okta" {
type = "okta"
name = "main-okta-integration"

# Okta Domain
external_id = "dev-12345.okta.com"

settings = {
# `type=okta` sym_integrations have a required setting `api_token_secret`,
# which must point to a sym_secret referencing your Okta API Key
api_token_secret = "xxx12345abcde"
# e.g. `sym_secret.okta_api_key.id`
api_token_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
}
}

# github integration
resource "sym_integration" "github" {
type = "github"
name = "main-okta-integration"
external_id = "my-github-org" # github org slug
# PagerDuty integration
resource "sym_integration" "pagerduty" {
type = "pagerduty"
name = "prod-pagerduty"

# PagerDuty domain
external_id = "mycompany.pagerduty.com"

settings = {
# `type=github` sym_integrations have a required setting `api_token_secret`,
# which must point to a sym_secret referencing your Github API Key
api_token_secret = "xxx12345abcde"
# `type=pagerduty` sym_integrations have a required setting `api_token_secret`,
# which must point to a sym_secret referencing your PagerDuty API Key
# e.g. `sym_secret.pagerduty_api_key.id`
api_token_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
}
}

# Segment Integration
resource "sym_integration" "segment" {
type = "segment"
name = "main-segment-integration"

# Your Segment Workspace name
external_id = "sym-test"

settings = {
# `type=segment` sym_integrations have a required setting `write_key_secret`,
# which must point to a sym_secret referencing your Segment Write Key
# e.g. `sym_secret.segment_write_key.id`
api_token_secret = "fc45d018-b8d3-4a6f-ae68-f94d17cf845a"
}
}

# runtime permission context integration

# Slack integration
resource "sym_integration" "slack" {
type = "slack"
name = "prod-workspace"

# Slack Workspace ID
external_id = "T1234567"
}

# Runtime Permission Context integration
resource "sym_integration" "runtime_context" {
type = "permission_context"
name = "aws-flow-context-test"
label = "Runtime context"
external_id = "123456789012"

# These settings will often be set to the output of a connector module (e.g. runtime-connector)
settings = {
cloud = "aws"
external_id = "1478F2AD-6091-41E6-B3D2-766CA2F173CB" # optional
Expand Down
2 changes: 1 addition & 1 deletion sym/provider/flow_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func flowSchema() map[string]*schema.Schema {
Required: true,
DiffSuppressFunc: utils.SuppressFlowDiffs,
ValidateDiagFunc: validateParams,
Description: "A set of parameters, as defined by the Template, which configure the Flow. See the documentation for your specific Template for more details.",
Description: "A set of parameters which configure the Flow. See the [Sym Documentation](https://docs.symops.com/docs/flow-parameters).",
},
}
}
Expand Down

0 comments on commit 37e7594

Please sign in to comment.