Skip to content

Commit

Permalink
feat: region tags examples and datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
wai-wong-edb committed Aug 22, 2024
1 parent 9952cb5 commit 13c129d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/resources/biganimal_region/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ variable "project_id" {
resource "biganimal_region" "this" {
cloud_provider = "aws"
region_id = "eu-west-1"
project_id = var.project_id
project_id = "prj_abc01234567"

tags = [
{
tag_name = "test"
color = "blue"
},
{
tag_name = "<ex-tag-name-2>"
},
]
}

output "region_status" {
Expand Down
17 changes: 17 additions & 0 deletions pkg/provider/data_source_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,23 @@ func (r *regionsDataSource) Schema(ctx context.Context, req datasource.SchemaReq
Description: "Unique region ID. For example, \"germanywestcentral\" in the Azure cloud provider, \"eu-west-1\" in the AWS cloud provider.",
Optional: true,
},
"tags": schema.SetNestedAttribute{
Description: "Assign existing tags or create tags to assign to this resource",
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"tag_id": schema.StringAttribute{
Computed: true,
},
"tag_name": schema.StringAttribute{
Computed: true,
},
"color": schema.StringAttribute{
Computed: true,
},
},
},
},
},
}
}
Expand Down

0 comments on commit 13c129d

Please sign in to comment.