Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that version is not part of the state if not explicitly in the tf file #181

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/resources/port_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-
resource "portintegration" "mycustomintegration" {
installationid = "my-custom-integration-id"
title = "My Custom Integration"
version = "1.33.7"
version = "1.33.7" # Optional, can be omitted
config = jsonencode({
createMissingRelatedEntitiesboolean = true
deleteDependentEntities = true,
Expand Down Expand Up @@ -56,7 +56,7 @@ Docs about how to import existing integrations and manage their mappings can be
resource "port_integration" "my_custom_integration" {
installation_id = "my-custom-integration-id"
title = "My Custom Integration"
version = "1.33.7"
version = "1.33.7" # Optional, can be omitted
config = jsonencode({
createMissingRelatedEntitiesboolean = true
deleteDependentEntities = true,
Expand Down
34 changes: 33 additions & 1 deletion examples/resources/port_integration/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
resource "port_integration" "my_custom_integration" {
installation_id = "my-custom-integration-id"
title = "My Custom Integration"
version = "1.33.7"
installation_app_type = "WEBHOOK"
config = jsonencode({
createMissingRelatedEntitiesboolean = true
Expand All @@ -27,3 +26,36 @@ resource "port_integration" "my_custom_integration" {
}]
})
}

resource "port_integration" "my_k8s_exporter" {
installation_id = "my-"
title = "My K8S Exporter with version managed by Terraform"
installation_app_type = "K8S EXPORTER"
# NOTE: This property is by default not used, since it can change outside of terraform
# Include this only if you explicitly want to control the version with Terraform
version = "1.33.7"
config = jsonencode({
createMissingRelatedEntitiesboolean = true
deleteDependentEntities = true
resources = [{
kind = "apps/v1/replicasets"
selector = {
query = ".metadata.namespace | startswith(\"kube\") | not"
}
port = {
entity = {
mappings = [{
identifier = ".metadata.name"
title = ".metadata.name"
blueprint = "'deploymentConfig'"
properties = {
creationTimestamp = ".metadata.creationTimestamp"
annotations = ".metadata.annotations"
status = ".status"
}
}]
}
}
}]
})
}
2 changes: 1 addition & 1 deletion port/integration/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func IntegrationSchema() map[string]schema.Attribute {
},
"version": schema.StringAttribute{
Optional: true,
Computed: true,
},
"title": schema.StringAttribute{
Optional: true,
Expand Down Expand Up @@ -73,7 +74,6 @@ Docs about how to import existing integrations and manage their mappings can be
resource "port_integration" "my_custom_integration" {
installation_id = "my-custom-integration-id"
title = "My Custom Integration"
version = "1.33.7"
config = jsonencode({
createMissingRelatedEntitiesboolean = true
deleteDependentEntities = true,
Expand Down
Loading