juju / terraform-provider-juju

A Terraform provider for Juju
Apache License 2.0
21 stars 43 forks source link

Schema: JAAS group data source #604

Closed pkulik0 closed 2 weeks ago

pkulik0 commented 1 month ago

Type of change

Adding new schema

Description

This schema change is needed for implementation of a data source for JAAS groups. We already have a resource for them and the schema attributes are exactly the same.

Details

"name": schema.StringAttribute{
    Description: "The name of the group.",
    Required:    true,
},
"uuid": schema.StringAttribute{
        Description: "The UUID of the group.",
    Computed:    true,
},

The JAAS group resource takes a name to create a group, so for ease of use this data source also takes in the attribute already known to users and fetches the UUID from JAAS.

Example terraform plan

resource "juju_jaas_group" "test" {
  name = "group-0"
}

// --------------- Second plan that uses the data source to use the group from plan #1

data "juju_jaas_group" "test" {
  name = "group-0"
}

Notes & References

No response

kian99 commented 1 month ago

Thanks for this, looks good to me.

hmlanigan commented 2 weeks ago

Approved.