1. Packages
  2. Cloudfoundry Provider
  3. API Docs
  4. ServicePlanAccess
cloudfoundry 0.54.0 published on Monday, Apr 14, 2025 by cloudfoundry-community

cloudfoundry.ServicePlanAccess

Explore with Pulumi AI

cloudfoundry logo
cloudfoundry 0.54.0 published on Monday, Apr 14, 2025 by cloudfoundry-community

    Provides a Cloud Foundry resource for managing access to service plans published by Cloud Foundry service brokers.

    NOTE: Multiple instances of this resource can be used to share a given service plan with multiple orgs. NOTE: This resource requires the provider to be authenticated with an account granted admin permissions.

    Example Usage

    The first example enables access to a specific plan of a given service broker to all organizations. The second example gives access to a specific org.

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudfoundry from "@pulumi/cloudfoundry";
    
    const org1_mysql_512mbServicePlanAccess = new cloudfoundry.ServicePlanAccess("org1-mysql-512mbServicePlanAccess", {
        plan: cloudfoundry_service_broker.mysql.service_plans["p-mysql/512mb"],
        "public": true,
    });
    const org1_mysql_512mbIndex_servicePlanAccessServicePlanAccess = new cloudfoundry.ServicePlanAccess("org1-mysql-512mbIndex/servicePlanAccessServicePlanAccess", {
        plan: cloudfoundry_service_broker.mysql.service_plans["p-mysql/1gb"],
        org: cloudfoundry_org.org1.id,
    });
    
    import pulumi
    import pulumi_cloudfoundry as cloudfoundry
    
    org1_mysql_512mb_service_plan_access = cloudfoundry.ServicePlanAccess("org1-mysql-512mbServicePlanAccess",
        plan=cloudfoundry_service_broker["mysql"]["service_plans"]["p-mysql/512mb"],
        public=True)
    org1_mysql_512mb_index_service_plan_access_service_plan_access = cloudfoundry.ServicePlanAccess("org1-mysql-512mbIndex/servicePlanAccessServicePlanAccess",
        plan=cloudfoundry_service_broker["mysql"]["service_plans"]["p-mysql/1gb"],
        org=cloudfoundry_org["org1"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/cloudfoundry/cloudfoundry"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    _, err := cloudfoundry.NewServicePlanAccess(ctx, "org1-mysql-512mbServicePlanAccess", &cloudfoundry.ServicePlanAccessArgs{
    Plan: pulumi.Any(cloudfoundry_service_broker.Mysql.Service_plans.PMysql/512mb),
    Public: pulumi.Bool(true),
    })
    if err != nil {
    return err
    }
    _, err = cloudfoundry.NewServicePlanAccess(ctx, "org1-mysql-512mbIndex/servicePlanAccessServicePlanAccess", &cloudfoundry.ServicePlanAccessArgs{
    Plan: pulumi.Any(cloudfoundry_service_broker.Mysql.Service_plans.PMysql/1gb),
    Org: pulumi.Any(cloudfoundry_org.Org1.Id),
    })
    if err != nil {
    return err
    }
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudfoundry = Pulumi.Cloudfoundry;
    
    return await Deployment.RunAsync(() => 
    {
        var org1_mysql_512mbServicePlanAccess = new Cloudfoundry.ServicePlanAccess("org1-mysql-512mbServicePlanAccess", new()
        {
            Plan = cloudfoundry_service_broker.Mysql.Service_plans.P_mysql_512mb,
            Public = true,
        });
    
        var org1_mysql_512mbIndex_servicePlanAccessServicePlanAccess = new Cloudfoundry.ServicePlanAccess("org1-mysql-512mbIndex/servicePlanAccessServicePlanAccess", new()
        {
            Plan = cloudfoundry_service_broker.Mysql.Service_plans.P_mysql_1gb,
            Org = cloudfoundry_org.Org1.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudfoundry.ServicePlanAccess;
    import com.pulumi.cloudfoundry.ServicePlanAccessArgs;
    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 org1_mysql_512mbServicePlanAccess = new ServicePlanAccess("org1-mysql-512mbServicePlanAccess", ServicePlanAccessArgs.builder()
                .plan(cloudfoundry_service_broker.mysql().service_plans().p-mysql/512mb())
                .public_(true)
                .build());
    
            var org1_mysql_512mbIndex_servicePlanAccessServicePlanAccess = new ServicePlanAccess("org1-mysql-512mbIndex/servicePlanAccessServicePlanAccess", ServicePlanAccessArgs.builder()
                .plan(cloudfoundry_service_broker.mysql().service_plans().p-mysql/1gb())
                .org(cloudfoundry_org.org1().id())
                .build());
    
        }
    }
    
    resources:
      org1-mysql-512mbServicePlanAccess:
        type: cloudfoundry:ServicePlanAccess
        properties:
          plan: ${cloudfoundry_service_broker.mysql.service_plans"p-mysql/512mb"[%!s(MISSING)]}
          public: true
      org1-mysql-512mbIndex/servicePlanAccessServicePlanAccess:
        type: cloudfoundry:ServicePlanAccess
        properties:
          plan: ${cloudfoundry_service_broker.mysql.service_plans"p-mysql/1gb"[%!s(MISSING)]}
          org: ${cloudfoundry_org.org1.id}
    

    Create ServicePlanAccess Resource

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

    Constructor syntax

    new ServicePlanAccess(name: string, args: ServicePlanAccessArgs, opts?: CustomResourceOptions);
    @overload
    def ServicePlanAccess(resource_name: str,
                          args: ServicePlanAccessArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServicePlanAccess(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          plan: Optional[str] = None,
                          org: Optional[str] = None,
                          public: Optional[bool] = None,
                          service_plan_access_id: Optional[str] = None)
    func NewServicePlanAccess(ctx *Context, name string, args ServicePlanAccessArgs, opts ...ResourceOption) (*ServicePlanAccess, error)
    public ServicePlanAccess(string name, ServicePlanAccessArgs args, CustomResourceOptions? opts = null)
    public ServicePlanAccess(String name, ServicePlanAccessArgs args)
    public ServicePlanAccess(String name, ServicePlanAccessArgs args, CustomResourceOptions options)
    
    type: cloudfoundry:ServicePlanAccess
    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 ServicePlanAccessArgs
    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 ServicePlanAccessArgs
    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 ServicePlanAccessArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServicePlanAccessArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServicePlanAccessArgs
    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 servicePlanAccessResource = new Cloudfoundry.ServicePlanAccess("servicePlanAccessResource", new()
    {
        Plan = "string",
        Org = "string",
        Public = false,
        ServicePlanAccessId = "string",
    });
    
    example, err := cloudfoundry.NewServicePlanAccess(ctx, "servicePlanAccessResource", &cloudfoundry.ServicePlanAccessArgs{
    	Plan:                pulumi.String("string"),
    	Org:                 pulumi.String("string"),
    	Public:              pulumi.Bool(false),
    	ServicePlanAccessId: pulumi.String("string"),
    })
    
    var servicePlanAccessResource = new ServicePlanAccess("servicePlanAccessResource", ServicePlanAccessArgs.builder()
        .plan("string")
        .org("string")
        .public_(false)
        .servicePlanAccessId("string")
        .build());
    
    service_plan_access_resource = cloudfoundry.ServicePlanAccess("servicePlanAccessResource",
        plan="string",
        org="string",
        public=False,
        service_plan_access_id="string")
    
    const servicePlanAccessResource = new cloudfoundry.ServicePlanAccess("servicePlanAccessResource", {
        plan: "string",
        org: "string",
        "public": false,
        servicePlanAccessId: "string",
    });
    
    type: cloudfoundry:ServicePlanAccess
    properties:
        org: string
        plan: string
        public: false
        servicePlanAccessId: string
    

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

    Plan string
    The ID of the service plan to grant access to
    Org string
    The ID of the Org which should have access to the plan. Conflicts with public.
    Public bool

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    ServicePlanAccessId string
    Plan string
    The ID of the service plan to grant access to
    Org string
    The ID of the Org which should have access to the plan. Conflicts with public.
    Public bool

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    ServicePlanAccessId string
    plan String
    The ID of the service plan to grant access to
    org String
    The ID of the Org which should have access to the plan. Conflicts with public.
    public_ Boolean

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    servicePlanAccessId String
    plan string
    The ID of the service plan to grant access to
    org string
    The ID of the Org which should have access to the plan. Conflicts with public.
    public boolean

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    servicePlanAccessId string
    plan str
    The ID of the service plan to grant access to
    org str
    The ID of the Org which should have access to the plan. Conflicts with public.
    public bool

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    service_plan_access_id str
    plan String
    The ID of the service plan to grant access to
    org String
    The ID of the Org which should have access to the plan. Conflicts with public.
    public Boolean

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    servicePlanAccessId String

    Outputs

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

    Get an existing ServicePlanAccess 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?: ServicePlanAccessState, opts?: CustomResourceOptions): ServicePlanAccess
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            org: Optional[str] = None,
            plan: Optional[str] = None,
            public: Optional[bool] = None,
            service_plan_access_id: Optional[str] = None) -> ServicePlanAccess
    func GetServicePlanAccess(ctx *Context, name string, id IDInput, state *ServicePlanAccessState, opts ...ResourceOption) (*ServicePlanAccess, error)
    public static ServicePlanAccess Get(string name, Input<string> id, ServicePlanAccessState? state, CustomResourceOptions? opts = null)
    public static ServicePlanAccess get(String name, Output<String> id, ServicePlanAccessState state, CustomResourceOptions options)
    resources:  _:    type: cloudfoundry:ServicePlanAccess    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:
    Org string
    The ID of the Org which should have access to the plan. Conflicts with public.
    Plan string
    The ID of the service plan to grant access to
    Public bool

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    ServicePlanAccessId string
    Org string
    The ID of the Org which should have access to the plan. Conflicts with public.
    Plan string
    The ID of the service plan to grant access to
    Public bool

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    ServicePlanAccessId string
    org String
    The ID of the Org which should have access to the plan. Conflicts with public.
    plan String
    The ID of the service plan to grant access to
    public_ Boolean

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    servicePlanAccessId String
    org string
    The ID of the Org which should have access to the plan. Conflicts with public.
    plan string
    The ID of the service plan to grant access to
    public boolean

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    servicePlanAccessId string
    org str
    The ID of the Org which should have access to the plan. Conflicts with public.
    plan str
    The ID of the service plan to grant access to
    public bool

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    service_plan_access_id str
    org String
    The ID of the Org which should have access to the plan. Conflicts with public.
    plan String
    The ID of the service plan to grant access to
    public Boolean

    Boolean that controls the public state of the plan. Conflicts with org.

    When neither org and public are given, the resource sets plan's public visibility to false at global level.

    servicePlanAccessId String

    Import

    The current Service Access can be imported using an id.

    If given id matches existing service_plan_visibilities,

    resource will be imported as a service_plan_access targeting an organization.

    If the given id matches a service plan id,

    then the resource will be imported as service_plan_access controlling plan’s public state.

    Otherwise, the import would fail.

    E.g.

    bash

    $ pulumi import cloudfoundry:index/servicePlanAccess:ServicePlanAccess org1-mysql-512mb a-guid
    

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

    Package Details

    Repository
    cloudfoundry cloudfoundry-community/terraform-provider-cloudfoundry
    License
    Notes
    This Pulumi package is based on the cloudfoundry Terraform Provider.
    cloudfoundry logo
    cloudfoundry 0.54.0 published on Monday, Apr 14, 2025 by cloudfoundry-community