1. Packages
  2. Juju Provider
  3. API Docs
  4. AccessOffer
juju 0.19.0 published on Wednesday, Apr 30, 2025 by juju

juju.AccessOffer

Explore with Pulumi AI

juju logo
juju 0.19.0 published on Wednesday, Apr 30, 2025 by juju

    A resource that represent a Juju Access Offer. Warning: Do not repeat users across different access levels.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as juju from "@pulumi/juju";
    
    const _this = new juju.AccessOffer("this", {
        offerUrl: juju_offer.my_application_offer.url,
        consumes: [juju_user.dev.name],
    });
    
    import pulumi
    import pulumi_juju as juju
    
    this = juju.AccessOffer("this",
        offer_url=juju_offer["my_application_offer"]["url"],
        consumes=[juju_user["dev"]["name"]])
    
    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.NewAccessOffer(ctx, "this", &juju.AccessOfferArgs{
    			OfferUrl: pulumi.Any(juju_offer.My_application_offer.Url),
    			Consumes: pulumi.StringArray{
    				juju_user.Dev.Name,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Juju = Pulumi.Juju;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = new Juju.AccessOffer("this", new()
        {
            OfferUrl = juju_offer.My_application_offer.Url,
            Consumes = new[]
            {
                juju_user.Dev.Name,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.juju.AccessOffer;
    import com.pulumi.juju.AccessOfferArgs;
    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 this_ = new AccessOffer("this", AccessOfferArgs.builder()
                .offerUrl(juju_offer.my_application_offer().url())
                .consumes(juju_user.dev().name())
                .build());
    
        }
    }
    
    resources:
      this:
        type: juju:AccessOffer
        properties:
          offerUrl: ${juju_offer.my_application_offer.url}
          consumes:
            - ${juju_user.dev.name}
    

    Create AccessOffer Resource

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

    Constructor syntax

    new AccessOffer(name: string, args: AccessOfferArgs, opts?: CustomResourceOptions);
    @overload
    def AccessOffer(resource_name: str,
                    args: AccessOfferArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccessOffer(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    offer_url: Optional[str] = None,
                    admins: Optional[Sequence[str]] = None,
                    consumes: Optional[Sequence[str]] = None,
                    reads: Optional[Sequence[str]] = None)
    func NewAccessOffer(ctx *Context, name string, args AccessOfferArgs, opts ...ResourceOption) (*AccessOffer, error)
    public AccessOffer(string name, AccessOfferArgs args, CustomResourceOptions? opts = null)
    public AccessOffer(String name, AccessOfferArgs args)
    public AccessOffer(String name, AccessOfferArgs args, CustomResourceOptions options)
    
    type: juju:AccessOffer
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AccessOfferArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AccessOfferArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AccessOfferArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccessOfferArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccessOfferArgs
    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 accessOfferResource = new Juju.AccessOffer("accessOfferResource", new()
    {
        OfferUrl = "string",
        Admins = new[]
        {
            "string",
        },
        Consumes = new[]
        {
            "string",
        },
        Reads = new[]
        {
            "string",
        },
    });
    
    example, err := juju.NewAccessOffer(ctx, "accessOfferResource", &juju.AccessOfferArgs{
    	OfferUrl: pulumi.String("string"),
    	Admins: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Consumes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Reads: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var accessOfferResource = new AccessOffer("accessOfferResource", AccessOfferArgs.builder()
        .offerUrl("string")
        .admins("string")
        .consumes("string")
        .reads("string")
        .build());
    
    access_offer_resource = juju.AccessOffer("accessOfferResource",
        offer_url="string",
        admins=["string"],
        consumes=["string"],
        reads=["string"])
    
    const accessOfferResource = new juju.AccessOffer("accessOfferResource", {
        offerUrl: "string",
        admins: ["string"],
        consumes: ["string"],
        reads: ["string"],
    });
    
    type: juju:AccessOffer
    properties:
        admins:
            - string
        consumes:
            - string
        offerUrl: string
        reads:
            - string
    

    AccessOffer 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 AccessOffer resource accepts the following input properties:

    OfferUrl string
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    Admins List<string>
    List of users to grant admin access. "admin" user is not allowed.
    Consumes List<string>
    List of users to grant consume access. "admin" user is not allowed.
    Reads List<string>
    List of users to grant read access. "admin" user is not allowed.
    OfferUrl string
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    Admins []string
    List of users to grant admin access. "admin" user is not allowed.
    Consumes []string
    List of users to grant consume access. "admin" user is not allowed.
    Reads []string
    List of users to grant read access. "admin" user is not allowed.
    offerUrl String
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    admins List<String>
    List of users to grant admin access. "admin" user is not allowed.
    consumes List<String>
    List of users to grant consume access. "admin" user is not allowed.
    reads List<String>
    List of users to grant read access. "admin" user is not allowed.
    offerUrl string
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    admins string[]
    List of users to grant admin access. "admin" user is not allowed.
    consumes string[]
    List of users to grant consume access. "admin" user is not allowed.
    reads string[]
    List of users to grant read access. "admin" user is not allowed.
    offer_url str
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    admins Sequence[str]
    List of users to grant admin access. "admin" user is not allowed.
    consumes Sequence[str]
    List of users to grant consume access. "admin" user is not allowed.
    reads Sequence[str]
    List of users to grant read access. "admin" user is not allowed.
    offerUrl String
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    admins List<String>
    List of users to grant admin access. "admin" user is not allowed.
    consumes List<String>
    List of users to grant consume access. "admin" user is not allowed.
    reads List<String>
    List of users to grant read access. "admin" user is not allowed.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AccessOffer 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 AccessOffer Resource

    Get an existing AccessOffer 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?: AccessOfferState, opts?: CustomResourceOptions): AccessOffer
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            admins: Optional[Sequence[str]] = None,
            consumes: Optional[Sequence[str]] = None,
            offer_url: Optional[str] = None,
            reads: Optional[Sequence[str]] = None) -> AccessOffer
    func GetAccessOffer(ctx *Context, name string, id IDInput, state *AccessOfferState, opts ...ResourceOption) (*AccessOffer, error)
    public static AccessOffer Get(string name, Input<string> id, AccessOfferState? state, CustomResourceOptions? opts = null)
    public static AccessOffer get(String name, Output<String> id, AccessOfferState state, CustomResourceOptions options)
    resources:  _:    type: juju:AccessOffer    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    Admins List<string>
    List of users to grant admin access. "admin" user is not allowed.
    Consumes List<string>
    List of users to grant consume access. "admin" user is not allowed.
    OfferUrl string
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    Reads List<string>
    List of users to grant read access. "admin" user is not allowed.
    Admins []string
    List of users to grant admin access. "admin" user is not allowed.
    Consumes []string
    List of users to grant consume access. "admin" user is not allowed.
    OfferUrl string
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    Reads []string
    List of users to grant read access. "admin" user is not allowed.
    admins List<String>
    List of users to grant admin access. "admin" user is not allowed.
    consumes List<String>
    List of users to grant consume access. "admin" user is not allowed.
    offerUrl String
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    reads List<String>
    List of users to grant read access. "admin" user is not allowed.
    admins string[]
    List of users to grant admin access. "admin" user is not allowed.
    consumes string[]
    List of users to grant consume access. "admin" user is not allowed.
    offerUrl string
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    reads string[]
    List of users to grant read access. "admin" user is not allowed.
    admins Sequence[str]
    List of users to grant admin access. "admin" user is not allowed.
    consumes Sequence[str]
    List of users to grant consume access. "admin" user is not allowed.
    offer_url str
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    reads Sequence[str]
    List of users to grant read access. "admin" user is not allowed.
    admins List<String>
    List of users to grant admin access. "admin" user is not allowed.
    consumes List<String>
    List of users to grant consume access. "admin" user is not allowed.
    offerUrl String
    The url of the offer for access management. If this is changed the resource will be deleted and a new resource will be created.
    reads List<String>
    List of users to grant read access. "admin" user is not allowed.

    Import

    Access Offers can be imported by using the Offer URL as in the juju show-offers output.

    Example:

    $juju show-offer mysql

    Store URL Access Description Endpoint Interface Role

    mycontroller admin/db.mysql admin MariaDB Server is one of the most … mysql mysql provider

    $ pulumi import juju:index/accessOffer:AccessOffer db admin/db.mysql
    

    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.
    juju logo
    juju 0.19.0 published on Wednesday, Apr 30, 2025 by juju