Package com.pulumi.aws.grafana
Class WorkspaceServiceAccountToken
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.grafana.WorkspaceServiceAccountToken
-
public class WorkspaceServiceAccountToken extends com.pulumi.resources.CustomResource> **Note:** You cannot update a service account token. If you change any attribute, Terraform will delete the current and create a new one. Read about Service Accounts Tokens in the [Amazon Managed Grafana user guide](https://docs.aws.amazon.com/grafana/latest/userguide/service-accounts.html#service-account-tokens). ## Example Usage ### Basic Usagepackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.grafana.WorkspaceServiceAccount; import com.pulumi.aws.grafana.WorkspaceServiceAccountArgs; import com.pulumi.aws.grafana.WorkspaceServiceAccountToken; import com.pulumi.aws.grafana.WorkspaceServiceAccountTokenArgs; import java.util.ArrayList; import java.util.Arrays; 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 WorkspaceServiceAccount("example", WorkspaceServiceAccountArgs.builder() .name("example-admin") .grafanaRole("ADMIN") .workspaceId(exampleAwsGrafanaWorkspace.id()) .build()); var exampleWorkspaceServiceAccountToken = new WorkspaceServiceAccountToken("exampleWorkspaceServiceAccountToken", WorkspaceServiceAccountTokenArgs.builder() .name("example-key") .serviceAccountId(example.serviceAccountId()) .secondsToLive(3600) .workspaceId(exampleAwsGrafanaWorkspace.id()) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description WorkspaceServiceAccountToken(java.lang.String name)WorkspaceServiceAccountToken(java.lang.String name, WorkspaceServiceAccountTokenArgs args)WorkspaceServiceAccountToken(java.lang.String name, WorkspaceServiceAccountTokenArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>createdAt()com.pulumi.core.Output<java.lang.String>expiresAt()static WorkspaceServiceAccountTokenget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, WorkspaceServiceAccountTokenState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>key()com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.Integer>secondsToLive()com.pulumi.core.Output<java.lang.String>serviceAccountId()com.pulumi.core.Output<java.lang.String>serviceAccountTokenId()com.pulumi.core.Output<java.lang.String>workspaceId()
-
-
-
Constructor Detail
-
WorkspaceServiceAccountToken
public WorkspaceServiceAccountToken(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
WorkspaceServiceAccountToken
public WorkspaceServiceAccountToken(java.lang.String name, WorkspaceServiceAccountTokenArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
WorkspaceServiceAccountToken
public WorkspaceServiceAccountToken(java.lang.String name, WorkspaceServiceAccountTokenArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
createdAt
public com.pulumi.core.Output<java.lang.String> createdAt()
- Returns:
- When the service account token was created.
-
expiresAt
public com.pulumi.core.Output<java.lang.String> expiresAt()
- Returns:
- When the service account token will expire.
-
key
public com.pulumi.core.Output<java.lang.String> key()
- Returns:
- Key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Name for the token to create. The name must be unique within the workspace.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
secondsToLive
public com.pulumi.core.Output<java.lang.Integer> secondsToLive()
- Returns:
- Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
-
serviceAccountId
public com.pulumi.core.Output<java.lang.String> serviceAccountId()
- Returns:
- ID of the service account for which to create a token.
-
serviceAccountTokenId
public com.pulumi.core.Output<java.lang.String> serviceAccountTokenId()
- Returns:
- Identifier of the service account token in the given Grafana workspace.
-
workspaceId
public com.pulumi.core.Output<java.lang.String> workspaceId()
- Returns:
- Grafana workspace with which the service account token is associated.
-
get
public static WorkspaceServiceAccountToken get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable WorkspaceServiceAccountTokenState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-