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

juju.Offer

Explore with Pulumi AI

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

    A resource that represent a Juju Offer.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as juju from "@pulumi/juju";
    
    const myoffer = new juju.Offer("myoffer", {
        model: juju_model.development.name,
        applicationName: juju_application["percona-cluster"].name,
        endpoint: server,
    });
    // an offer can then be used in an cross model integration as below:
    const myintegration = new juju.Integration("myintegration", {
        model: juju_model["development-destination"].name,
        applications: [
            {
                name: juju_application.wordpress.name,
                endpoint: "db",
            },
            {
                offerUrl: myoffer.url,
            },
        ],
    });
    
    import pulumi
    import pulumi_juju as juju
    
    myoffer = juju.Offer("myoffer",
        model=juju_model["development"]["name"],
        application_name=juju_application["percona-cluster"]["name"],
        endpoint=server)
    # an offer can then be used in an cross model integration as below:
    myintegration = juju.Integration("myintegration",
        model=juju_model["development-destination"]["name"],
        applications=[
            {
                "name": juju_application["wordpress"]["name"],
                "endpoint": "db",
            },
            {
                "offer_url": myoffer.url,
            },
        ])
    
    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 {
    		myoffer, err := juju.NewOffer(ctx, "myoffer", &juju.OfferArgs{
    			Model:           pulumi.Any(juju_model.Development.Name),
    			ApplicationName: pulumi.Any(juju_application.PerconaCluster.Name),
    			Endpoint:        pulumi.Any(server),
    		})
    		if err != nil {
    			return err
    		}
    		// an offer can then be used in an cross model integration as below:
    		_, err = juju.NewIntegration(ctx, "myintegration", &juju.IntegrationArgs{
    			Model: pulumi.Any(juju_model.DevelopmentDestination.Name),
    			Applications: juju.IntegrationApplicationArray{
    				&juju.IntegrationApplicationArgs{
    					Name:     pulumi.Any(juju_application.Wordpress.Name),
    					Endpoint: pulumi.String("db"),
    				},
    				&juju.IntegrationApplicationArgs{
    					OfferUrl: myoffer.Url,
    				},
    			},
    		})
    		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 myoffer = new Juju.Offer("myoffer", new()
        {
            Model = juju_model.Development.Name,
            ApplicationName = juju_application.Percona_cluster.Name,
            Endpoint = server,
        });
    
        // an offer can then be used in an cross model integration as below:
        var myintegration = new Juju.Integration("myintegration", new()
        {
            Model = juju_model.Development_destination.Name,
            Applications = new[]
            {
                new Juju.Inputs.IntegrationApplicationArgs
                {
                    Name = juju_application.Wordpress.Name,
                    Endpoint = "db",
                },
                new Juju.Inputs.IntegrationApplicationArgs
                {
                    OfferUrl = myoffer.Url,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.juju.Offer;
    import com.pulumi.juju.OfferArgs;
    import com.pulumi.juju.Integration;
    import com.pulumi.juju.IntegrationArgs;
    import com.pulumi.juju.inputs.IntegrationApplicationArgs;
    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 myoffer = new Offer("myoffer", OfferArgs.builder()
                .model(juju_model.development().name())
                .applicationName(juju_application.percona-cluster().name())
                .endpoint(server)
                .build());
    
            // an offer can then be used in an cross model integration as below:
            var myintegration = new Integration("myintegration", IntegrationArgs.builder()
                .model(juju_model.development-destination().name())
                .applications(            
                    IntegrationApplicationArgs.builder()
                        .name(juju_application.wordpress().name())
                        .endpoint("db")
                        .build(),
                    IntegrationApplicationArgs.builder()
                        .offerUrl(myoffer.url())
                        .build())
                .build());
    
        }
    }
    
    resources:
      myoffer:
        type: juju:Offer
        properties:
          model: ${juju_model.development.name}
          applicationName: ${juju_application"percona-cluster"[%!s(MISSING)].name}
          endpoint: ${server}
      # an offer can then be used in an cross model integration as below:
      myintegration:
        type: juju:Integration
        properties:
          model: ${juju_model"development-destination"[%!s(MISSING)].name}
          applications:
            - name: ${juju_application.wordpress.name}
              endpoint: db
            - offerUrl: ${myoffer.url}
    

    Create Offer Resource

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

    Constructor syntax

    new Offer(name: string, args: OfferArgs, opts?: CustomResourceOptions);
    @overload
    def Offer(resource_name: str,
              args: OfferArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Offer(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              application_name: Optional[str] = None,
              endpoint: Optional[str] = None,
              model: Optional[str] = None,
              name: Optional[str] = None)
    func NewOffer(ctx *Context, name string, args OfferArgs, opts ...ResourceOption) (*Offer, error)
    public Offer(string name, OfferArgs args, CustomResourceOptions? opts = null)
    public Offer(String name, OfferArgs args)
    public Offer(String name, OfferArgs args, CustomResourceOptions options)
    
    type: juju:Offer
    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 OfferArgs
    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 OfferArgs
    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 OfferArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OfferArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OfferArgs
    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 offerResource = new Juju.Offer("offerResource", new()
    {
        ApplicationName = "string",
        Endpoint = "string",
        Model = "string",
        Name = "string",
    });
    
    example, err := juju.NewOffer(ctx, "offerResource", &juju.OfferArgs{
    	ApplicationName: pulumi.String("string"),
    	Endpoint:        pulumi.String("string"),
    	Model:           pulumi.String("string"),
    	Name:            pulumi.String("string"),
    })
    
    var offerResource = new Offer("offerResource", OfferArgs.builder()
        .applicationName("string")
        .endpoint("string")
        .model("string")
        .name("string")
        .build());
    
    offer_resource = juju.Offer("offerResource",
        application_name="string",
        endpoint="string",
        model="string",
        name="string")
    
    const offerResource = new juju.Offer("offerResource", {
        applicationName: "string",
        endpoint: "string",
        model: "string",
        name: "string",
    });
    
    type: juju:Offer
    properties:
        applicationName: string
        endpoint: string
        model: string
        name: string
    

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

    ApplicationName string
    Endpoint string
    Model string
    Name string
    ApplicationName string
    Endpoint string
    Model string
    Name string
    applicationName String
    endpoint String
    model String
    name String
    applicationName string
    endpoint string
    model string
    name string
    applicationName String
    endpoint String
    model String
    name String

    Outputs

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

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

    Look up Existing Offer Resource

    Get an existing Offer 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?: OfferState, opts?: CustomResourceOptions): Offer
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_name: Optional[str] = None,
            endpoint: Optional[str] = None,
            model: Optional[str] = None,
            name: Optional[str] = None,
            url: Optional[str] = None) -> Offer
    func GetOffer(ctx *Context, name string, id IDInput, state *OfferState, opts ...ResourceOption) (*Offer, error)
    public static Offer Get(string name, Input<string> id, OfferState? state, CustomResourceOptions? opts = null)
    public static Offer get(String name, Output<String> id, OfferState state, CustomResourceOptions options)
    resources:  _:    type: juju:Offer    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:
    ApplicationName string
    Endpoint string
    Model string
    Name string
    Url string
    The offer URL.
    ApplicationName string
    Endpoint string
    Model string
    Name string
    Url string
    The offer URL.
    applicationName String
    endpoint String
    model String
    name String
    url String
    The offer URL.
    applicationName string
    endpoint string
    model string
    name string
    url string
    The offer URL.
    application_name str
    endpoint str
    model str
    name str
    url str
    The offer URL.
    applicationName String
    endpoint String
    model String
    name String
    url String
    The offer URL.

    Import

    Offers can be imported by using the 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/offer:Offer 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