Skip to content

Commit

Permalink
Changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jcieslak committed Nov 8, 2024
1 parent 1eb9816 commit 1251438
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions docs/resources/primary_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
page_title: "snowflake_primary_connection Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
Resource used to manage primary connections. For managing replicated connection check resource snowflakesecondaryconnection https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/resources/secondary_connection.md. For more information, check connection documentation https://docs.snowflake.com/en/sql-reference/sql/create-connection.html.
Resource used to manage primary connections. For managing replicated connection check resource snowflakesecondaryconnection ./secondary_connection. For more information, check connection documentation https://docs.snowflake.com/en/sql-reference/sql/create-connection.html.
---

!> **V1 release candidate** This resource is a release candidate for the V1. It is on the list of remaining GA objects for V1. We do not expect significant changes in it before the V1. We will welcome any feedback and adjust the resource if needed. Any errors reported will be resolved with a higher priority. We encourage checking this resource out before the V1 release. Please follow the [migration guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#v0970--v0980) to use it.

# snowflake_primary_connection (Resource)

Resource used to manage primary connections. For managing replicated connection check resource [snowflake_secondary_connection](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/resources/secondary_connection.md). For more information, check [connection documentation](https://docs.snowflake.com/en/sql-reference/sql/create-connection.html).
Resource used to manage primary connections. For managing replicated connection check resource [snowflake_secondary_connection](./secondary_connection). For more information, check [connection documentation](https://docs.snowflake.com/en/sql-reference/sql/create-connection.html).

## Example Usage

Expand All @@ -29,9 +29,9 @@ resource "snowflake_primary_connection" "complete" {
}
```

-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](./docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).

-> **Note** To demote [`snowflake_primary_connection`](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/primary_connection) to [`snowflake_secondary_connection`](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/secondary_connection), resources need to be migrated manually. For guidance on removing and importing resources into the state check [resource migration](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/resource_migration.md). Remove the resource from the state, then recreate it in manually using:
-> **Note** To demote [`snowflake_primary_connection`](./primary_connection) to [`snowflake_secondary_connection`](./secondary_connection), resources need to be migrated manually. For guidance on removing and importing resources into the state check [resource migration](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/resource_migration.md). Remove the resource from the state, then recreate it in manually using:
```
CREATE CONNECTION <name> AS REPLICA OF <organization_name>.<account_name>.<connection_name>;
```
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/secondary_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
page_title: "snowflake_secondary_connection Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
Resource used to manage secondary (replicated) connections. To manage primary connection check resource sonwflakeprimaryconnection https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/resources/primary_connection.md. For more information, check connection documentation https://docs.snowflake.com/en/sql-reference/sql/create-connection.html.
Resource used to manage secondary (replicated) connections. To manage primary connection check resource snowflakeprimaryconnection ./primary_connection. For more information, check connection documentation https://docs.snowflake.com/en/sql-reference/sql/create-connection.html.
---

!> **V1 release candidate** This resource is a release candidate for the V1. It is on the list of remaining GA objects for V1. We do not expect significant changes in it before the V1. We will welcome any feedback and adjust the resource if needed. Any errors reported will be resolved with a higher priority. We encourage checking this resource out before the V1 release. Please follow the [migration guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#v0970--v0980) to use it.

# snowflake_secondary_connection (Resource)

Resource used to manage secondary (replicated) connections. To manage primary connection check resource [sonwflake_primary_connection](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/resources/primary_connection.md). For more information, check [connection documentation](https://docs.snowflake.com/en/sql-reference/sql/create-connection.html).
Resource used to manage secondary (replicated) connections. To manage primary connection check resource [snowflake_primary_connection](./primary_connection). For more information, check [connection documentation](https://docs.snowflake.com/en/sql-reference/sql/create-connection.html).

## Example Usage

Expand All @@ -28,9 +28,9 @@ resource "snowflake_secondary_connection" "complete" {
}
```

-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](../guides/identifiers#new-computed-fully-qualified-name-field-in-resources).

-> **Note** To promote secondary_connection to primary_connection, resources need to be migrated manually. For guidance on removing and importing resources into the state check [resource migration](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/resource_migration.md). Remove the resource from the state, then promote it manually using:
-> **Note** To promote [`snowflake_secondary_connection`](./secondary_connection) to [`snowflake_primary_connection`](./primary_connection), resources need to be migrated manually. For guidance on removing and importing resources into the state check [resource migration](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/resource_migration.md). Remove the resource from the state, then promote it manually using:
```
ALTER CONNECTION <name> PRIMARY;
```
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/primary_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func PrimaryConnection() *schema.Resource {
RecreateWhenResourceBoolFieldChangedExternally("is_primary", true),
),

Description: "Resource used to manage primary connections. For managing replicated connection check resource [snowflake_secondary_connection](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/resources/secondary_connection.md). For more information, check [connection documentation](https://docs.snowflake.com/en/sql-reference/sql/create-connection.html).",
Description: "Resource used to manage primary connections. For managing replicated connection check resource [snowflake_secondary_connection](./secondary_connection). For more information, check [connection documentation](https://docs.snowflake.com/en/sql-reference/sql/create-connection.html).",
Schema: primaryConnectionSchema,
Importer: &schema.ResourceImporter{
StateContext: ImportName[sdk.AccountObjectIdentifier],
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/secondary_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func SecondaryConnection() *schema.Resource {
ReadContext: ReadContextSecondaryConnection,
UpdateContext: UpdateContextSecondaryConnection,
DeleteContext: DeleteContextSecondaryConnection,
Description: "Resource used to manage secondary (replicated) connections. To manage primary connection check resource [sonwflake_primary_connection](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/resources/primary_connection.md). For more information, check [connection documentation](https://docs.snowflake.com/en/sql-reference/sql/create-connection.html).",
Description: "Resource used to manage secondary (replicated) connections. To manage primary connection check resource [snowflake_primary_connection](./primary_connection). For more information, check [connection documentation](https://docs.snowflake.com/en/sql-reference/sql/create-connection.html).",

CustomizeDiff: customdiff.All(
ComputedIfAnyAttributeChanged(secondaryConnectionSchema, ShowOutputAttributeName, "comment", "is_primary"),
Expand Down
4 changes: 2 additions & 2 deletions templates/resources/primary_connection.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ description: |-

{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}}

-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](./docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).

-> **Note** To demote [`snowflake_primary_connection`](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/primary_connection) to [`snowflake_secondary_connection`](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/secondary_connection), resources need to be migrated manually. For guidance on removing and importing resources into the state check [resource migration](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/resource_migration.md). Remove the resource from the state, then recreate it in manually using:
-> **Note** To demote [`snowflake_primary_connection`](./primary_connection) to [`snowflake_secondary_connection`](./secondary_connection), resources need to be migrated manually. For guidance on removing and importing resources into the state check [resource migration](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/resource_migration.md). Remove the resource from the state, then recreate it in manually using:
```
CREATE CONNECTION <name> AS REPLICA OF <organization_name>.<account_name>.<connection_name>;
```
Expand Down
4 changes: 2 additions & 2 deletions templates/resources/secondary_connection.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ description: |-

{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}}

-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](../guides/identifiers#new-computed-fully-qualified-name-field-in-resources).

-> **Note** To promote secondary_connection to primary_connection, resources need to be migrated manually. For guidance on removing and importing resources into the state check [resource migration](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/resource_migration.md). Remove the resource from the state, then promote it manually using:
-> **Note** To promote [`snowflake_secondary_connection`](./secondary_connection) to [`snowflake_primary_connection`](./primary_connection), resources need to be migrated manually. For guidance on removing and importing resources into the state check [resource migration](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/resource_migration.md). Remove the resource from the state, then promote it manually using:
```
ALTER CONNECTION <name> PRIMARY;
```
Expand Down

0 comments on commit 1251438

Please sign in to comment.