Skip to content

Commit

Permalink
Change port to port-labs (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvirsegev authored Aug 9, 2022
1 parent 78ffcee commit 34cc173
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 41 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

[![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/devex-community/shared_invite/zt-1bmf5621e-GGfuJdMPK2D8UN58qL4E_g)


Port is the Developer Platform meant to supercharge your DevOps and Developers, and allow you to regain control of your environment.

### Docs
* [Provider Docs](https://registry.terraform.io/providers/port-labs/port/latest/docs)
* [Port Docs](https://docs.getport.io/)

- [Provider Docs](https://registry.terraform.io/providers/port-labs/port/latest/docs)
- [Port Docs](https://docs.getport.io/)

## Installation

Expand All @@ -24,7 +24,7 @@ terraform {
}
provider "port" {}
resource "port_entity" "microservice" {
resource "port-labs_entity" "microservice" {
title = "monolith"
blueprint = "microservice_blueprint"
properties {
Expand Down
12 changes: 5 additions & 7 deletions docs/resources/entity.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "port_entity Resource - terraform-provider-port"
page_title: "port-labs_entity Resource - terraform-provider-port"
subcategory: ""
description: |-
Port entity
---

# port_entity (Resource)
# port-labs_entity (Resource)

Port entity



<!-- schema generated by tfplugindocs -->

## Schema

### Required
Expand All @@ -35,6 +34,7 @@ Port entity
- `updated_by` (String)

<a id="nestedblock--properties"></a>

### Nested Schema for `properties`

Required:
Expand All @@ -47,13 +47,11 @@ Optional:
- `items` (List of String) The list of items, in case the type of this property is a list
- `value` (String) The value for this property


<a id="nestedblock--relations"></a>

### Nested Schema for `relations`

Required:

- `identifier` (String) The id of the connected entity
- `name` (String) The name of the relation


14 changes: 7 additions & 7 deletions examples/main.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
terraform {
required_providers {
port = {
source = "port-labs/port"
source = "port-labs/port-labs"
version = "~> 0.0.1"
}
}
}
provider "port" {}
provider "port-labs" {}

resource "port_entity" "microservice" {
title = "monolith"
resource "port-labs_entity" "microservice" {
title = "monolith"
blueprint = "microservice_blueprint"
properties {
name = "microservice_name"
name = "microservice_name"
value = "golang_monolith"
type = "string"
type = "string"
}
}
}
10 changes: 5 additions & 5 deletions examples/provider/basic/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
provider "port" {}

resource "port_entity" "microservice" {
title = "monolith"
resource "port-labs_entity" "microservice" {
title = "monolith"
blueprint = "microservice_blueprint"
properties {
name = "microservice_name"
name = "microservice_name"
value = "golang_monolith"
type = "string"
type = "string"
}
}
}
6 changes: 3 additions & 3 deletions examples/resources/port_entity/main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
resource "port_entity" "microservice" {
resource "port-labs_entity" "microservice" {
title = "monolith"
blueprint = "microservice_blueprint"
relations {
name = "tf-relation"
identifier = port_entity.prod_env.id
identifier = port-labs_entity.prod_env.id
}
properties {
name = "microservice_name"
Expand All @@ -12,7 +12,7 @@ resource "port_entity" "microservice" {
}
}

resource "port_entity" "prod_env" {
resource "port-labs_entity" "prod_env" {
title = "production"
blueprint = "environments"
properties {
Expand Down
2 changes: 1 addition & 1 deletion port/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Provider() *schema.Provider {
},
},
ResourcesMap: map[string]*schema.Resource{
"port_entity": newEntityResource(),
"port-labs_entity": newEntityResource(),
},
DataSourcesMap: map[string]*schema.Resource{},
ConfigureContextFunc: providerConfigure,
Expand Down
28 changes: 14 additions & 14 deletions port/resource_port_entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

func TestAccPortEntityUpdateProp(t *testing.T) {
var testAccActionConfigCreate = `
provider "port" {}
resource "port_entity" "microservice" {
provider "port-labs" {}
resource "port-labs_entity" "microservice" {
title = "monolith"
blueprint = "tf-provider-test-bp"
properties {
Expand All @@ -21,8 +21,8 @@ func TestAccPortEntityUpdateProp(t *testing.T) {
}
`
var testAccActionConfigUpdate = `
provider "port" {}
resource "port_entity" "microservice" {
provider "port-labs" {}
resource "port-labs_entity" "microservice" {
title = "monolith"
blueprint = "tf-provider-test-bp"
properties {
Expand All @@ -34,24 +34,24 @@ func TestAccPortEntityUpdateProp(t *testing.T) {
`
resource.Test(t, resource.TestCase{
Providers: map[string]*schema.Provider{
"port": Provider(),
"port-labs": Provider(),
},
Steps: []resource.TestStep{
{
Config: testAccActionConfigCreate,
},
{
Config: testAccActionConfigUpdate,
Check: resource.TestCheckResourceAttr("port_entity.microservice", "properties.0.value", "hedwig2"),
Check: resource.TestCheckResourceAttr("port-labs_entity.microservice", "properties.0.value", "hedwig2"),
},
},
})
}

func TestAccPortEntity(t *testing.T) {
var testAccActionConfigCreate = `
provider "port" {}
resource "port_entity" "microservice" {
provider "port-labs" {}
resource "port-labs_entity" "microservice" {
title = "monolith"
blueprint = "tf-provider-test-bp"
properties {
Expand Down Expand Up @@ -83,7 +83,7 @@ func TestAccPortEntity(t *testing.T) {
`
resource.Test(t, resource.TestCase{
Providers: map[string]*schema.Provider{
"port": Provider(),
"port-labs": Provider(),
},
Steps: []resource.TestStep{
{
Expand All @@ -95,21 +95,21 @@ func TestAccPortEntity(t *testing.T) {

func TestAccPortEntitiesRelation(t *testing.T) {
var testAccActionConfigCreate = `
provider "port" {}
resource "port_entity" "microservice" {
provider "port-labs" {}
resource "port-labs_entity" "microservice" {
title = "monolith"
blueprint = "tf-provider-test-bp"
relations {
name = "tf-relation"
identifier = port_entity.microservice2.id
identifier = port-labs_entity.microservice2.id
}
properties {
name = "text"
value = "test-relation"
type = "string"
}
}
resource "port_entity" "microservice2" {
resource "port-labs_entity" "microservice2" {
title = "monolith2"
blueprint = "tf-provider-test-bp2"
properties {
Expand All @@ -121,7 +121,7 @@ func TestAccPortEntitiesRelation(t *testing.T) {
`
resource.Test(t, resource.TestCase{
Providers: map[string]*schema.Provider{
"port": Provider(),
"port-labs": Provider(),
},
Steps: []resource.TestStep{
{
Expand Down

0 comments on commit 34cc173

Please sign in to comment.