1. Packages
  2. Juju Provider
  3. API Docs
  4. JaasAccessModel
juju 0.18.0 published on Monday, Apr 14, 2025 by juju

juju.JaasAccessModel

Explore with Pulumi AI

A resource that represent access to a model when using JAAS.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as juju from "@pulumi/juju";

const development = new juju.JaasAccessModel("development", {
    modelUuid: juju_model.development.uuid,
    access: "administrator",
    users: ["foo@domain.com"],
    groups: [juju_jaas_group.development.uuid],
    serviceAccounts: [
        "Client-ID-1",
        "Client-ID-2",
    ],
});
Copy
import pulumi
import pulumi_juju as juju

development = juju.JaasAccessModel("development",
    model_uuid=juju_model["development"]["uuid"],
    access="administrator",
    users=["foo@domain.com"],
    groups=[juju_jaas_group["development"]["uuid"]],
    service_accounts=[
        "Client-ID-1",
        "Client-ID-2",
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/juju/juju"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := juju.NewJaasAccessModel(ctx, "development", &juju.JaasAccessModelArgs{
			ModelUuid: pulumi.Any(juju_model.Development.Uuid),
			Access:    pulumi.String("administrator"),
			Users: pulumi.StringArray{
				pulumi.String("foo@domain.com"),
			},
			Groups: pulumi.StringArray{
				juju_jaas_group.Development.Uuid,
			},
			ServiceAccounts: pulumi.StringArray{
				pulumi.String("Client-ID-1"),
				pulumi.String("Client-ID-2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Juju = Pulumi.Juju;

return await Deployment.RunAsync(() => 
{
    var development = new Juju.JaasAccessModel("development", new()
    {
        ModelUuid = juju_model.Development.Uuid,
        Access = "administrator",
        Users = new[]
        {
            "foo@domain.com",
        },
        Groups = new[]
        {
            juju_jaas_group.Development.Uuid,
        },
        ServiceAccounts = new[]
        {
            "Client-ID-1",
            "Client-ID-2",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.juju.JaasAccessModel;
import com.pulumi.juju.JaasAccessModelArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var development = new JaasAccessModel("development", JaasAccessModelArgs.builder()
            .modelUuid(juju_model.development().uuid())
            .access("administrator")
            .users("foo@domain.com")
            .groups(juju_jaas_group.development().uuid())
            .serviceAccounts(            
                "Client-ID-1",
                "Client-ID-2")
            .build());

    }
}
Copy
resources:
  development:
    type: juju:JaasAccessModel
    properties:
      modelUuid: ${juju_model.development.uuid}
      access: administrator
      users:
        - foo@domain.com
      groups:
        - ${juju_jaas_group.development.uuid}
      serviceAccounts:
        - Client-ID-1
        - Client-ID-2
Copy

Create JaasAccessModel Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new JaasAccessModel(name: string, args: JaasAccessModelArgs, opts?: CustomResourceOptions);
@overload
def JaasAccessModel(resource_name: str,
                    args: JaasAccessModelArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def JaasAccessModel(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    access: Optional[str] = None,
                    model_uuid: Optional[str] = None,
                    groups: Optional[Sequence[str]] = None,
                    roles: Optional[Sequence[str]] = None,
                    service_accounts: Optional[Sequence[str]] = None,
                    users: Optional[Sequence[str]] = None)
func NewJaasAccessModel(ctx *Context, name string, args JaasAccessModelArgs, opts ...ResourceOption) (*JaasAccessModel, error)
public JaasAccessModel(string name, JaasAccessModelArgs args, CustomResourceOptions? opts = null)
public JaasAccessModel(String name, JaasAccessModelArgs args)
public JaasAccessModel(String name, JaasAccessModelArgs args, CustomResourceOptions options)
type: juju:JaasAccessModel
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. JaasAccessModelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. JaasAccessModelArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. JaasAccessModelArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. JaasAccessModelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. JaasAccessModelArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var jaasAccessModelResource = new Juju.JaasAccessModel("jaasAccessModelResource", new()
{
    Access = "string",
    ModelUuid = "string",
    Groups = new[]
    {
        "string",
    },
    Roles = new[]
    {
        "string",
    },
    ServiceAccounts = new[]
    {
        "string",
    },
    Users = new[]
    {
        "string",
    },
});
Copy
example, err := juju.NewJaasAccessModel(ctx, "jaasAccessModelResource", &juju.JaasAccessModelArgs{
Access: pulumi.String("string"),
ModelUuid: pulumi.String("string"),
Groups: pulumi.StringArray{
pulumi.String("string"),
},
Roles: pulumi.StringArray{
pulumi.String("string"),
},
ServiceAccounts: pulumi.StringArray{
pulumi.String("string"),
},
Users: pulumi.StringArray{
pulumi.String("string"),
},
})
Copy
var jaasAccessModelResource = new JaasAccessModel("jaasAccessModelResource", JaasAccessModelArgs.builder()
    .access("string")
    .modelUuid("string")
    .groups("string")
    .roles("string")
    .serviceAccounts("string")
    .users("string")
    .build());
Copy
jaas_access_model_resource = juju.JaasAccessModel("jaasAccessModelResource",
    access="string",
    model_uuid="string",
    groups=["string"],
    roles=["string"],
    service_accounts=["string"],
    users=["string"])
Copy
const jaasAccessModelResource = new juju.JaasAccessModel("jaasAccessModelResource", {
    access: "string",
    modelUuid: "string",
    groups: ["string"],
    roles: ["string"],
    serviceAccounts: ["string"],
    users: ["string"],
});
Copy
type: juju:JaasAccessModel
properties:
    access: string
    groups:
        - string
    modelUuid: string
    roles:
        - string
    serviceAccounts:
        - string
    users:
        - string
Copy

JaasAccessModel Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The JaasAccessModel resource accepts the following input properties:

Access This property is required. string
ModelUuid This property is required. string
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
Groups List<string>
List of groups to grant access. A valid group ID is the group's UUID.
Roles List<string>
List of roles UUIDs to grant access.
ServiceAccounts List<string>
List of service accounts to grant access. A valid service account is the service account's name.
Users List<string>
List of users to grant access. A valid user is the user's name or email.
Access This property is required. string
ModelUuid This property is required. string
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
Groups []string
List of groups to grant access. A valid group ID is the group's UUID.
Roles []string
List of roles UUIDs to grant access.
ServiceAccounts []string
List of service accounts to grant access. A valid service account is the service account's name.
Users []string
List of users to grant access. A valid user is the user's name or email.
access This property is required. String
modelUuid This property is required. String
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
groups List<String>
List of groups to grant access. A valid group ID is the group's UUID.
roles List<String>
List of roles UUIDs to grant access.
serviceAccounts List<String>
List of service accounts to grant access. A valid service account is the service account's name.
users List<String>
List of users to grant access. A valid user is the user's name or email.
access This property is required. string
modelUuid This property is required. string
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
groups string[]
List of groups to grant access. A valid group ID is the group's UUID.
roles string[]
List of roles UUIDs to grant access.
serviceAccounts string[]
List of service accounts to grant access. A valid service account is the service account's name.
users string[]
List of users to grant access. A valid user is the user's name or email.
access This property is required. str
model_uuid This property is required. str
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
groups Sequence[str]
List of groups to grant access. A valid group ID is the group's UUID.
roles Sequence[str]
List of roles UUIDs to grant access.
service_accounts Sequence[str]
List of service accounts to grant access. A valid service account is the service account's name.
users Sequence[str]
List of users to grant access. A valid user is the user's name or email.
access This property is required. String
modelUuid This property is required. String
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
groups List<String>
List of groups to grant access. A valid group ID is the group's UUID.
roles List<String>
List of roles UUIDs to grant access.
serviceAccounts List<String>
List of service accounts to grant access. A valid service account is the service account's name.
users List<String>
List of users to grant access. A valid user is the user's name or email.

Outputs

All input properties are implicitly available as output properties. Additionally, the JaasAccessModel resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing JaasAccessModel Resource

Get an existing JaasAccessModel resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: JaasAccessModelState, opts?: CustomResourceOptions): JaasAccessModel
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access: Optional[str] = None,
        groups: Optional[Sequence[str]] = None,
        model_uuid: Optional[str] = None,
        roles: Optional[Sequence[str]] = None,
        service_accounts: Optional[Sequence[str]] = None,
        users: Optional[Sequence[str]] = None) -> JaasAccessModel
func GetJaasAccessModel(ctx *Context, name string, id IDInput, state *JaasAccessModelState, opts ...ResourceOption) (*JaasAccessModel, error)
public static JaasAccessModel Get(string name, Input<string> id, JaasAccessModelState? state, CustomResourceOptions? opts = null)
public static JaasAccessModel get(String name, Output<String> id, JaasAccessModelState state, CustomResourceOptions options)
resources:  _:    type: juju:JaasAccessModel    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Access string
Groups List<string>
List of groups to grant access. A valid group ID is the group's UUID.
ModelUuid string
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
Roles List<string>
List of roles UUIDs to grant access.
ServiceAccounts List<string>
List of service accounts to grant access. A valid service account is the service account's name.
Users List<string>
List of users to grant access. A valid user is the user's name or email.
Access string
Groups []string
List of groups to grant access. A valid group ID is the group's UUID.
ModelUuid string
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
Roles []string
List of roles UUIDs to grant access.
ServiceAccounts []string
List of service accounts to grant access. A valid service account is the service account's name.
Users []string
List of users to grant access. A valid user is the user's name or email.
access String
groups List<String>
List of groups to grant access. A valid group ID is the group's UUID.
modelUuid String
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
roles List<String>
List of roles UUIDs to grant access.
serviceAccounts List<String>
List of service accounts to grant access. A valid service account is the service account's name.
users List<String>
List of users to grant access. A valid user is the user's name or email.
access string
groups string[]
List of groups to grant access. A valid group ID is the group's UUID.
modelUuid string
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
roles string[]
List of roles UUIDs to grant access.
serviceAccounts string[]
List of service accounts to grant access. A valid service account is the service account's name.
users string[]
List of users to grant access. A valid user is the user's name or email.
access str
groups Sequence[str]
List of groups to grant access. A valid group ID is the group's UUID.
model_uuid str
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
roles Sequence[str]
List of roles UUIDs to grant access.
service_accounts Sequence[str]
List of service accounts to grant access. A valid service account is the service account's name.
users Sequence[str]
List of users to grant access. A valid user is the user's name or email.
access String
groups List<String>
List of groups to grant access. A valid group ID is the group's UUID.
modelUuid String
The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.
roles List<String>
List of roles UUIDs to grant access.
serviceAccounts List<String>
List of service accounts to grant access. A valid service account is the service account's name.
users List<String>
List of users to grant access. A valid user is the user's name or email.

Import

JAAS model access can be imported using the model name and access level

$ pulumi import juju:index/jaasAccessModel:JaasAccessModel development development:can_addmodel
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
juju juju/terraform-provider-juju
License
Notes
This Pulumi package is based on the juju Terraform Provider.