1. Packages
  2. Harness
  3. API Docs
  4. platform
  5. SpotConnector
Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs

harness.platform.SpotConnector

Explore with Pulumi AI

harness logo
Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs

    Resource for creating a Spot connector.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Harness = Lbrlabs.PulumiPackage.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        var spot = new Harness.Platform.SpotConnector("spot", new()
        {
            Description = "description of spot connector",
            Identifier = "example_spot_cloud_provider",
            PermanentToken = new Harness.Platform.Inputs.SpotConnectorPermanentTokenArgs
            {
                ApiTokenRef = "account.TEST_spot_api_token",
                DelegateSelectors = new[]
                {
                    "harness-delegate",
                },
                ExecuteOnDelegate = false,
                SpotAccountId = "<my-account-id>",
            },
            Tags = new[]
            {
                "foo:bar",
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/lbrlabs/pulumi-harness/sdk/go/harness/platform"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := platform.NewSpotConnector(ctx, "spot", &platform.SpotConnectorArgs{
    			Description: pulumi.String("description of spot connector"),
    			Identifier:  pulumi.String("example_spot_cloud_provider"),
    			PermanentToken: &platform.SpotConnectorPermanentTokenArgs{
    				ApiTokenRef: pulumi.String("account.TEST_spot_api_token"),
    				DelegateSelectors: pulumi.StringArray{
    					pulumi.String("harness-delegate"),
    				},
    				ExecuteOnDelegate: pulumi.Bool(false),
    				SpotAccountId:     pulumi.String("<my-account-id>"),
    			},
    			Tags: pulumi.StringArray{
    				pulumi.String("foo:bar"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.SpotConnector;
    import com.pulumi.harness.platform.SpotConnectorArgs;
    import com.pulumi.harness.platform.inputs.SpotConnectorPermanentTokenArgs;
    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 spot = new SpotConnector("spot", SpotConnectorArgs.builder()        
                .description("description of spot connector")
                .identifier("example_spot_cloud_provider")
                .permanentToken(SpotConnectorPermanentTokenArgs.builder()
                    .apiTokenRef("account.TEST_spot_api_token")
                    .delegateSelectors("harness-delegate")
                    .executeOnDelegate(false)
                    .spotAccountId("<my-account-id>")
                    .build())
                .tags("foo:bar")
                .build());
    
        }
    }
    
    import pulumi
    import lbrlabs_pulumi_harness as harness
    
    spot = harness.platform.SpotConnector("spot",
        description="description of spot connector",
        identifier="example_spot_cloud_provider",
        permanent_token=harness.platform.SpotConnectorPermanentTokenArgs(
            api_token_ref="account.TEST_spot_api_token",
            delegate_selectors=["harness-delegate"],
            execute_on_delegate=False,
            spot_account_id="<my-account-id>",
        ),
        tags=["foo:bar"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@lbrlabs/pulumi-harness";
    
    const spot = new harness.platform.SpotConnector("spot", {
        description: "description of spot connector",
        identifier: "example_spot_cloud_provider",
        permanentToken: {
            apiTokenRef: "account.TEST_spot_api_token",
            delegateSelectors: ["harness-delegate"],
            executeOnDelegate: false,
            spotAccountId: "<my-account-id>",
        },
        tags: ["foo:bar"],
    });
    
    resources:
      spot:
        type: harness:platform:SpotConnector
        properties:
          description: description of spot connector
          identifier: example_spot_cloud_provider
          permanentToken:
            apiTokenRef: account.TEST_spot_api_token
            delegateSelectors:
              - harness-delegate
            executeOnDelegate: false
            spotAccountId: <my-account-id>
          tags:
            - foo:bar
    

    Create SpotConnector Resource

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

    Constructor syntax

    new SpotConnector(name: string, args: SpotConnectorArgs, opts?: CustomResourceOptions);
    @overload
    def SpotConnector(resource_name: str,
                      args: SpotConnectorArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def SpotConnector(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      identifier: Optional[str] = None,
                      permanent_token: Optional[SpotConnectorPermanentTokenArgs] = None,
                      description: Optional[str] = None,
                      name: Optional[str] = None,
                      org_id: Optional[str] = None,
                      project_id: Optional[str] = None,
                      tags: Optional[Sequence[str]] = None)
    func NewSpotConnector(ctx *Context, name string, args SpotConnectorArgs, opts ...ResourceOption) (*SpotConnector, error)
    public SpotConnector(string name, SpotConnectorArgs args, CustomResourceOptions? opts = null)
    public SpotConnector(String name, SpotConnectorArgs args)
    public SpotConnector(String name, SpotConnectorArgs args, CustomResourceOptions options)
    
    type: harness:platform:SpotConnector
    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 SpotConnectorArgs
    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 SpotConnectorArgs
    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 SpotConnectorArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SpotConnectorArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SpotConnectorArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var spotConnectorResource = new Harness.Platform.SpotConnector("spotConnectorResource", new()
    {
        Identifier = "string",
        PermanentToken = new Harness.Platform.Inputs.SpotConnectorPermanentTokenArgs
        {
            ApiTokenRef = "string",
            DelegateSelectors = new[]
            {
                "string",
            },
            ExecuteOnDelegate = false,
            SpotAccountId = "string",
            SpotAccountIdRef = "string",
        },
        Description = "string",
        Name = "string",
        OrgId = "string",
        ProjectId = "string",
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := platform.NewSpotConnector(ctx, "spotConnectorResource", &platform.SpotConnectorArgs{
    	Identifier: pulumi.String("string"),
    	PermanentToken: &platform.SpotConnectorPermanentTokenArgs{
    		ApiTokenRef: pulumi.String("string"),
    		DelegateSelectors: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		ExecuteOnDelegate: pulumi.Bool(false),
    		SpotAccountId:     pulumi.String("string"),
    		SpotAccountIdRef:  pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	OrgId:       pulumi.String("string"),
    	ProjectId:   pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var spotConnectorResource = new SpotConnector("spotConnectorResource", SpotConnectorArgs.builder()        
        .identifier("string")
        .permanentToken(SpotConnectorPermanentTokenArgs.builder()
            .apiTokenRef("string")
            .delegateSelectors("string")
            .executeOnDelegate(false)
            .spotAccountId("string")
            .spotAccountIdRef("string")
            .build())
        .description("string")
        .name("string")
        .orgId("string")
        .projectId("string")
        .tags("string")
        .build());
    
    spot_connector_resource = harness.platform.SpotConnector("spotConnectorResource",
        identifier="string",
        permanent_token=harness.platform.SpotConnectorPermanentTokenArgs(
            api_token_ref="string",
            delegate_selectors=["string"],
            execute_on_delegate=False,
            spot_account_id="string",
            spot_account_id_ref="string",
        ),
        description="string",
        name="string",
        org_id="string",
        project_id="string",
        tags=["string"])
    
    const spotConnectorResource = new harness.platform.SpotConnector("spotConnectorResource", {
        identifier: "string",
        permanentToken: {
            apiTokenRef: "string",
            delegateSelectors: ["string"],
            executeOnDelegate: false,
            spotAccountId: "string",
            spotAccountIdRef: "string",
        },
        description: "string",
        name: "string",
        orgId: "string",
        projectId: "string",
        tags: ["string"],
    });
    
    type: harness:platform:SpotConnector
    properties:
        description: string
        identifier: string
        name: string
        orgId: string
        permanentToken:
            apiTokenRef: string
            delegateSelectors:
                - string
            executeOnDelegate: false
            spotAccountId: string
            spotAccountIdRef: string
        projectId: string
        tags:
            - string
    

    SpotConnector Resource Properties

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

    Inputs

    The SpotConnector resource accepts the following input properties:

    Identifier string
    Unique identifier of the resource.
    PermanentToken Lbrlabs.PulumiPackage.Harness.Platform.Inputs.SpotConnectorPermanentToken
    Authenticate to Spot using account id and permanent token.
    Description string
    Description of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags List<string>
    Tags to associate with the resource.
    Identifier string
    Unique identifier of the resource.
    PermanentToken SpotConnectorPermanentTokenArgs
    Authenticate to Spot using account id and permanent token.
    Description string
    Description of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags []string
    Tags to associate with the resource.
    identifier String
    Unique identifier of the resource.
    permanentToken SpotConnectorPermanentToken
    Authenticate to Spot using account id and permanent token.
    description String
    Description of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    identifier string
    Unique identifier of the resource.
    permanentToken SpotConnectorPermanentToken
    Authenticate to Spot using account id and permanent token.
    description string
    Description of the resource.
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    tags string[]
    Tags to associate with the resource.
    identifier str
    Unique identifier of the resource.
    permanent_token SpotConnectorPermanentTokenArgs
    Authenticate to Spot using account id and permanent token.
    description str
    Description of the resource.
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    tags Sequence[str]
    Tags to associate with the resource.
    identifier String
    Unique identifier of the resource.
    permanentToken Property Map
    Authenticate to Spot using account id and permanent token.
    description String
    Description of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.

    Outputs

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

    Get an existing SpotConnector 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?: SpotConnectorState, opts?: CustomResourceOptions): SpotConnector
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            identifier: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            permanent_token: Optional[SpotConnectorPermanentTokenArgs] = None,
            project_id: Optional[str] = None,
            tags: Optional[Sequence[str]] = None) -> SpotConnector
    func GetSpotConnector(ctx *Context, name string, id IDInput, state *SpotConnectorState, opts ...ResourceOption) (*SpotConnector, error)
    public static SpotConnector Get(string name, Input<string> id, SpotConnectorState? state, CustomResourceOptions? opts = null)
    public static SpotConnector get(String name, Output<String> id, SpotConnectorState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Description string
    Description of the resource.
    Identifier string
    Unique identifier of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    PermanentToken Lbrlabs.PulumiPackage.Harness.Platform.Inputs.SpotConnectorPermanentToken
    Authenticate to Spot using account id and permanent token.
    ProjectId string
    Unique identifier of the project.
    Tags List<string>
    Tags to associate with the resource.
    Description string
    Description of the resource.
    Identifier string
    Unique identifier of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    PermanentToken SpotConnectorPermanentTokenArgs
    Authenticate to Spot using account id and permanent token.
    ProjectId string
    Unique identifier of the project.
    Tags []string
    Tags to associate with the resource.
    description String
    Description of the resource.
    identifier String
    Unique identifier of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    permanentToken SpotConnectorPermanentToken
    Authenticate to Spot using account id and permanent token.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    description string
    Description of the resource.
    identifier string
    Unique identifier of the resource.
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    permanentToken SpotConnectorPermanentToken
    Authenticate to Spot using account id and permanent token.
    projectId string
    Unique identifier of the project.
    tags string[]
    Tags to associate with the resource.
    description str
    Description of the resource.
    identifier str
    Unique identifier of the resource.
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    permanent_token SpotConnectorPermanentTokenArgs
    Authenticate to Spot using account id and permanent token.
    project_id str
    Unique identifier of the project.
    tags Sequence[str]
    Tags to associate with the resource.
    description String
    Description of the resource.
    identifier String
    Unique identifier of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    permanentToken Property Map
    Authenticate to Spot using account id and permanent token.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.

    Supporting Types

    SpotConnectorPermanentToken, SpotConnectorPermanentTokenArgs

    ApiTokenRef string
    Reference to the Harness secret containing the permanent api token. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    DelegateSelectors List<string>
    Connect only using delegates with these tags.
    ExecuteOnDelegate bool
    Execute on delegate or not.
    SpotAccountId string
    Spot account id.
    SpotAccountIdRef string
    Reference to the Harness secret containing the spot account id. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    ApiTokenRef string
    Reference to the Harness secret containing the permanent api token. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    DelegateSelectors []string
    Connect only using delegates with these tags.
    ExecuteOnDelegate bool
    Execute on delegate or not.
    SpotAccountId string
    Spot account id.
    SpotAccountIdRef string
    Reference to the Harness secret containing the spot account id. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    apiTokenRef String
    Reference to the Harness secret containing the permanent api token. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    delegateSelectors List<String>
    Connect only using delegates with these tags.
    executeOnDelegate Boolean
    Execute on delegate or not.
    spotAccountId String
    Spot account id.
    spotAccountIdRef String
    Reference to the Harness secret containing the spot account id. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    apiTokenRef string
    Reference to the Harness secret containing the permanent api token. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    delegateSelectors string[]
    Connect only using delegates with these tags.
    executeOnDelegate boolean
    Execute on delegate or not.
    spotAccountId string
    Spot account id.
    spotAccountIdRef string
    Reference to the Harness secret containing the spot account id. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    api_token_ref str
    Reference to the Harness secret containing the permanent api token. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    delegate_selectors Sequence[str]
    Connect only using delegates with these tags.
    execute_on_delegate bool
    Execute on delegate or not.
    spot_account_id str
    Spot account id.
    spot_account_id_ref str
    Reference to the Harness secret containing the spot account id. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    apiTokenRef String
    Reference to the Harness secret containing the permanent api token. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.
    delegateSelectors List<String>
    Connect only using delegates with these tags.
    executeOnDelegate Boolean
    Execute on delegate or not.
    spotAccountId String
    Spot account id.
    spotAccountIdRef String
    Reference to the Harness secret containing the spot account id. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.

    Import

    Import using spot cloud provider connector id

     $ pulumi import harness:platform/spotConnector:SpotConnector example <connector_id>
    

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

    Package Details

    Repository
    harness lbrlabs/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs