harness.platform.ServiceAccount
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";
const example = new harness.platform.ServiceAccount("example", {
identifier: "identifier",
name: "name",
email: "email@service.harness.io",
description: "test",
tags: ["foo:bar"],
accountId: "account_id",
});
import pulumi
import pulumi_harness as harness
example = harness.platform.ServiceAccount("example",
identifier="identifier",
name="name",
email="email@service.harness.io",
description="test",
tags=["foo:bar"],
account_id="account_id")
package main
import (
"github.com/pulumi/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.NewServiceAccount(ctx, "example", &platform.ServiceAccountArgs{
Identifier: pulumi.String("identifier"),
Name: pulumi.String("name"),
Email: pulumi.String("email@service.harness.io"),
Description: pulumi.String("test"),
Tags: pulumi.StringArray{
pulumi.String("foo:bar"),
},
AccountId: pulumi.String("account_id"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;
return await Deployment.RunAsync(() =>
{
var example = new Harness.Platform.ServiceAccount("example", new()
{
Identifier = "identifier",
Name = "name",
Email = "email@service.harness.io",
Description = "test",
Tags = new[]
{
"foo:bar",
},
AccountId = "account_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.ServiceAccount;
import com.pulumi.harness.platform.ServiceAccountArgs;
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 example = new ServiceAccount("example", ServiceAccountArgs.builder()
.identifier("identifier")
.name("name")
.email("email@service.harness.io")
.description("test")
.tags("foo:bar")
.accountId("account_id")
.build());
}
}
resources:
example:
type: harness:platform:ServiceAccount
properties:
identifier: identifier
name: name
email: email@service.harness.io
description: test
tags:
- foo:bar
accountId: account_id
Create ServiceAccount Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServiceAccount(name: string, args: ServiceAccountArgs, opts?: CustomResourceOptions);
@overload
def ServiceAccount(resource_name: str,
args: ServiceAccountArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServiceAccount(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
email: Optional[str] = None,
identifier: Optional[str] = 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 NewServiceAccount(ctx *Context, name string, args ServiceAccountArgs, opts ...ResourceOption) (*ServiceAccount, error)
public ServiceAccount(string name, ServiceAccountArgs args, CustomResourceOptions? opts = null)
public ServiceAccount(String name, ServiceAccountArgs args)
public ServiceAccount(String name, ServiceAccountArgs args, CustomResourceOptions options)
type: harness:platform:ServiceAccount
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 ServiceAccountArgs
- 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 ServiceAccountArgs
- 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 ServiceAccountArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceAccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceAccountArgs
- 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 serviceAccountResource = new Harness.Platform.ServiceAccount("serviceAccountResource", new()
{
AccountId = "string",
Email = "string",
Identifier = "string",
Description = "string",
Name = "string",
OrgId = "string",
ProjectId = "string",
Tags = new[]
{
"string",
},
});
example, err := platform.NewServiceAccount(ctx, "serviceAccountResource", &platform.ServiceAccountArgs{
AccountId: pulumi.String("string"),
Email: pulumi.String("string"),
Identifier: 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 serviceAccountResource = new ServiceAccount("serviceAccountResource", ServiceAccountArgs.builder()
.accountId("string")
.email("string")
.identifier("string")
.description("string")
.name("string")
.orgId("string")
.projectId("string")
.tags("string")
.build());
service_account_resource = harness.platform.ServiceAccount("serviceAccountResource",
account_id="string",
email="string",
identifier="string",
description="string",
name="string",
org_id="string",
project_id="string",
tags=["string"])
const serviceAccountResource = new harness.platform.ServiceAccount("serviceAccountResource", {
accountId: "string",
email: "string",
identifier: "string",
description: "string",
name: "string",
orgId: "string",
projectId: "string",
tags: ["string"],
});
type: harness:platform:ServiceAccount
properties:
accountId: string
description: string
email: string
identifier: string
name: string
orgId: string
projectId: string
tags:
- string
ServiceAccount 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 ServiceAccount resource accepts the following input properties:
- Account
Id string - Account Identifier for the Entity.
- Email string
- Email of the Service Account.
- Identifier string
- Unique identifier of the resource.
- Description string
- Description of the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id string - Unique identifier of the project.
- List<string>
- Tags to associate with the resource.
- Account
Id string - Account Identifier for the Entity.
- Email string
- Email of the Service Account.
- Identifier string
- Unique identifier of the resource.
- Description string
- Description of the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id string - Unique identifier of the project.
- []string
- Tags to associate with the resource.
- account
Id String - Account Identifier for the Entity.
- email String
- Email of the Service Account.
- identifier String
- Unique identifier of the resource.
- description String
- Description of the resource.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- project
Id String - Unique identifier of the project.
- List<String>
- Tags to associate with the resource.
- account
Id string - Account Identifier for the Entity.
- email string
- Email of the Service Account.
- identifier string
- Unique identifier of the resource.
- description string
- Description of the resource.
- name string
- Name of the resource.
- org
Id string - Unique identifier of the organization.
- project
Id string - Unique identifier of the project.
- string[]
- Tags to associate with the resource.
- account_
id str - Account Identifier for the Entity.
- email str
- Email of the Service Account.
- identifier str
- Unique identifier of the resource.
- 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.
- Sequence[str]
- Tags to associate with the resource.
- account
Id String - Account Identifier for the Entity.
- email String
- Email of the Service Account.
- identifier String
- Unique identifier of the resource.
- description String
- Description of the resource.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- project
Id String - Unique identifier of the project.
- List<String>
- Tags to associate with the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServiceAccount 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 ServiceAccount Resource
Get an existing ServiceAccount 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?: ServiceAccountState, opts?: CustomResourceOptions): ServiceAccount
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
description: Optional[str] = None,
email: Optional[str] = None,
identifier: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
project_id: Optional[str] = None,
tags: Optional[Sequence[str]] = None) -> ServiceAccount
func GetServiceAccount(ctx *Context, name string, id IDInput, state *ServiceAccountState, opts ...ResourceOption) (*ServiceAccount, error)
public static ServiceAccount Get(string name, Input<string> id, ServiceAccountState? state, CustomResourceOptions? opts = null)
public static ServiceAccount get(String name, Output<String> id, ServiceAccountState 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.
- Account
Id string - Account Identifier for the Entity.
- Description string
- Description of the resource.
- Email string
- Email of the Service Account.
- Identifier string
- Unique identifier of the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id string - Unique identifier of the project.
- List<string>
- Tags to associate with the resource.
- Account
Id string - Account Identifier for the Entity.
- Description string
- Description of the resource.
- Email string
- Email of the Service Account.
- Identifier string
- Unique identifier of the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id string - Unique identifier of the project.
- []string
- Tags to associate with the resource.
- account
Id String - Account Identifier for the Entity.
- description String
- Description of the resource.
- email String
- Email of the Service Account.
- identifier String
- Unique identifier of the resource.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- project
Id String - Unique identifier of the project.
- List<String>
- Tags to associate with the resource.
- account
Id string - Account Identifier for the Entity.
- description string
- Description of the resource.
- email string
- Email of the Service Account.
- identifier string
- Unique identifier of the resource.
- name string
- Name of the resource.
- org
Id string - Unique identifier of the organization.
- project
Id string - Unique identifier of the project.
- string[]
- Tags to associate with the resource.
- account_
id str - Account Identifier for the Entity.
- description str
- Description of the resource.
- email str
- Email of the Service Account.
- identifier str
- Unique identifier 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.
- Sequence[str]
- Tags to associate with the resource.
- account
Id String - Account Identifier for the Entity.
- description String
- Description of the resource.
- email String
- Email of the Service Account.
- identifier String
- Unique identifier of the resource.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- project
Id String - Unique identifier of the project.
- List<String>
- Tags to associate with the resource.
Import
Import account level service account
$ pulumi import harness:platform/serviceAccount:ServiceAccount example <service_account_id>
Import org level service account
$ pulumi import harness:platform/serviceAccount:ServiceAccount example <ord_id>/<service_account_id>
Import project level service account
$ pulumi import harness:platform/serviceAccount:ServiceAccount example <org_id>/<project_id>/<service_account_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- harness pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
harness
Terraform Provider.