aws.amp.Workspace
Explore with Pulumi AI
Manages an Amazon Managed Service for Prometheus (AMP) Workspace.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.amp.Workspace("example", {
alias: "example",
tags: {
Environment: "production",
},
});
import pulumi
import pulumi_aws as aws
example = aws.amp.Workspace("example",
alias="example",
tags={
"Environment": "production",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/amp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := amp.NewWorkspace(ctx, "example", &.WorkspaceArgs{
Alias: pulumi.String("example"),
Tags: pulumi.StringMap{
"Environment": pulumi.String("production"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Amp.Workspace("example", new()
{
Alias = "example",
Tags =
{
{ "Environment", "production" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.amp.Workspace;
import com.pulumi.aws.amp.WorkspaceArgs;
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 Workspace("example", WorkspaceArgs.builder()
.alias("example")
.tags(Map.of("Environment", "production"))
.build());
}
}
resources:
example:
type: aws:amp:Workspace
properties:
alias: example
tags:
Environment: production
CloudWatch Logging
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.cloudwatch.LogGroup("example", {name: "example"});
const exampleWorkspace = new aws.amp.Workspace("example", {loggingConfiguration: {
logGroupArn: pulumi.interpolate`${example.arn}:*`,
}});
import pulumi
import pulumi_aws as aws
example = aws.cloudwatch.LogGroup("example", name="example")
example_workspace = aws.amp.Workspace("example", logging_configuration={
"log_group_arn": example.arn.apply(lambda arn: f"{arn}:*"),
})
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/amp"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := cloudwatch.NewLogGroup(ctx, "example", &cloudwatch.LogGroupArgs{
Name: pulumi.String("example"),
})
if err != nil {
return err
}
_, err = amp.NewWorkspace(ctx, "example", &.WorkspaceArgs{
LoggingConfiguration: &.WorkspaceLoggingConfigurationArgs{
LogGroupArn: example.Arn.ApplyT(func(arn string) (string, error) {
return fmt.Sprintf("%v:*", arn), nil
}).(pulumi.StringOutput),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.CloudWatch.LogGroup("example", new()
{
Name = "example",
});
var exampleWorkspace = new Aws.Amp.Workspace("example", new()
{
LoggingConfiguration = new Aws.Amp.Inputs.WorkspaceLoggingConfigurationArgs
{
LogGroupArn = example.Arn.Apply(arn => $"{arn}:*"),
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogGroup;
import com.pulumi.aws.cloudwatch.LogGroupArgs;
import com.pulumi.aws.amp.Workspace;
import com.pulumi.aws.amp.WorkspaceArgs;
import com.pulumi.aws.amp.inputs.WorkspaceLoggingConfigurationArgs;
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 LogGroup("example", LogGroupArgs.builder()
.name("example")
.build());
var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
.loggingConfiguration(WorkspaceLoggingConfigurationArgs.builder()
.logGroupArn(example.arn().applyValue(arn -> String.format("%s:*", arn)))
.build())
.build());
}
}
resources:
example:
type: aws:cloudwatch:LogGroup
properties:
name: example
exampleWorkspace:
type: aws:amp:Workspace
name: example
properties:
loggingConfiguration:
logGroupArn: ${example.arn}:*
AWS KMS Customer Managed Keys (CMK)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleKey = new aws.kms.Key("example", {
description: "example",
deletionWindowInDays: 7,
});
const example = new aws.amp.Workspace("example", {
alias: "example",
kmsKeyArn: exampleKey.arn,
});
import pulumi
import pulumi_aws as aws
example_key = aws.kms.Key("example",
description="example",
deletion_window_in_days=7)
example = aws.amp.Workspace("example",
alias="example",
kms_key_arn=example_key.arn)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/amp"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleKey, err := kms.NewKey(ctx, "example", &kms.KeyArgs{
Description: pulumi.String("example"),
DeletionWindowInDays: pulumi.Int(7),
})
if err != nil {
return err
}
_, err = amp.NewWorkspace(ctx, "example", &.WorkspaceArgs{
Alias: pulumi.String("example"),
KmsKeyArn: exampleKey.Arn,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleKey = new Aws.Kms.Key("example", new()
{
Description = "example",
DeletionWindowInDays = 7,
});
var example = new Aws.Amp.Workspace("example", new()
{
Alias = "example",
KmsKeyArn = exampleKey.Arn,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kms.Key;
import com.pulumi.aws.kms.KeyArgs;
import com.pulumi.aws.amp.Workspace;
import com.pulumi.aws.amp.WorkspaceArgs;
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 exampleKey = new Key("exampleKey", KeyArgs.builder()
.description("example")
.deletionWindowInDays(7)
.build());
var example = new Workspace("example", WorkspaceArgs.builder()
.alias("example")
.kmsKeyArn(exampleKey.arn())
.build());
}
}
resources:
example:
type: aws:amp:Workspace
properties:
alias: example
kmsKeyArn: ${exampleKey.arn}
exampleKey:
type: aws:kms:Key
name: example
properties:
description: example
deletionWindowInDays: 7
Create Workspace Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Workspace(name: string, args?: WorkspaceArgs, opts?: CustomResourceOptions);
@overload
def Workspace(resource_name: str,
args: Optional[WorkspaceArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Workspace(resource_name: str,
opts: Optional[ResourceOptions] = None,
alias: Optional[str] = None,
kms_key_arn: Optional[str] = None,
logging_configuration: Optional[WorkspaceLoggingConfigurationArgs] = None,
tags: Optional[Mapping[str, str]] = None)
func NewWorkspace(ctx *Context, name string, args *WorkspaceArgs, opts ...ResourceOption) (*Workspace, error)
public Workspace(string name, WorkspaceArgs? args = null, CustomResourceOptions? opts = null)
public Workspace(String name, WorkspaceArgs args)
public Workspace(String name, WorkspaceArgs args, CustomResourceOptions options)
type: aws:amp:Workspace
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 WorkspaceArgs
- 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 WorkspaceArgs
- 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 WorkspaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkspaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkspaceArgs
- 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 workspaceResource = new Aws.Amp.Workspace("workspaceResource", new()
{
Alias = "string",
KmsKeyArn = "string",
LoggingConfiguration = new Aws.Amp.Inputs.WorkspaceLoggingConfigurationArgs
{
LogGroupArn = "string",
},
Tags =
{
{ "string", "string" },
},
});
example, err := amp.NewWorkspace(ctx, "workspaceResource", &.WorkspaceArgs{
Alias: pulumi.String("string"),
KmsKeyArn: pulumi.String("string"),
LoggingConfiguration: &.WorkspaceLoggingConfigurationArgs{
LogGroupArn: pulumi.String("string"),
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var workspaceResource = new Workspace("workspaceResource", WorkspaceArgs.builder()
.alias("string")
.kmsKeyArn("string")
.loggingConfiguration(WorkspaceLoggingConfigurationArgs.builder()
.logGroupArn("string")
.build())
.tags(Map.of("string", "string"))
.build());
workspace_resource = aws.amp.Workspace("workspaceResource",
alias="string",
kms_key_arn="string",
logging_configuration={
"log_group_arn": "string",
},
tags={
"string": "string",
})
const workspaceResource = new aws.amp.Workspace("workspaceResource", {
alias: "string",
kmsKeyArn: "string",
loggingConfiguration: {
logGroupArn: "string",
},
tags: {
string: "string",
},
});
type: aws:amp:Workspace
properties:
alias: string
kmsKeyArn: string
loggingConfiguration:
logGroupArn: string
tags:
string: string
Workspace 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 Workspace resource accepts the following input properties:
- Alias string
- The alias of the prometheus workspace. See more in AWS Docs.
- Kms
Key stringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- Logging
Configuration WorkspaceLogging Configuration - Logging configuration for the workspace. See Logging Configuration below for details.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Alias string
- The alias of the prometheus workspace. See more in AWS Docs.
- Kms
Key stringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- Logging
Configuration WorkspaceLogging Configuration Args - Logging configuration for the workspace. See Logging Configuration below for details.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- alias String
- The alias of the prometheus workspace. See more in AWS Docs.
- kms
Key StringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- logging
Configuration WorkspaceLogging Configuration - Logging configuration for the workspace. See Logging Configuration below for details.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- alias string
- The alias of the prometheus workspace. See more in AWS Docs.
- kms
Key stringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- logging
Configuration WorkspaceLogging Configuration - Logging configuration for the workspace. See Logging Configuration below for details.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- alias str
- The alias of the prometheus workspace. See more in AWS Docs.
- kms_
key_ strarn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- logging_
configuration WorkspaceLogging Configuration Args - Logging configuration for the workspace. See Logging Configuration below for details.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- alias String
- The alias of the prometheus workspace. See more in AWS Docs.
- kms
Key StringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- logging
Configuration Property Map - Logging configuration for the workspace. See Logging Configuration below for details.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Workspace resource produces the following output properties:
- Arn string
- Amazon Resource Name (ARN) of the workspace.
- Id string
- The provider-assigned unique ID for this managed resource.
- Prometheus
Endpoint string - Prometheus endpoint available for this workspace.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- Amazon Resource Name (ARN) of the workspace.
- Id string
- The provider-assigned unique ID for this managed resource.
- Prometheus
Endpoint string - Prometheus endpoint available for this workspace.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- Amazon Resource Name (ARN) of the workspace.
- id String
- The provider-assigned unique ID for this managed resource.
- prometheus
Endpoint String - Prometheus endpoint available for this workspace.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- Amazon Resource Name (ARN) of the workspace.
- id string
- The provider-assigned unique ID for this managed resource.
- prometheus
Endpoint string - Prometheus endpoint available for this workspace.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- Amazon Resource Name (ARN) of the workspace.
- id str
- The provider-assigned unique ID for this managed resource.
- prometheus_
endpoint str - Prometheus endpoint available for this workspace.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- Amazon Resource Name (ARN) of the workspace.
- id String
- The provider-assigned unique ID for this managed resource.
- prometheus
Endpoint String - Prometheus endpoint available for this workspace.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing Workspace Resource
Get an existing Workspace 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?: WorkspaceState, opts?: CustomResourceOptions): Workspace
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
alias: Optional[str] = None,
arn: Optional[str] = None,
kms_key_arn: Optional[str] = None,
logging_configuration: Optional[WorkspaceLoggingConfigurationArgs] = None,
prometheus_endpoint: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> Workspace
func GetWorkspace(ctx *Context, name string, id IDInput, state *WorkspaceState, opts ...ResourceOption) (*Workspace, error)
public static Workspace Get(string name, Input<string> id, WorkspaceState? state, CustomResourceOptions? opts = null)
public static Workspace get(String name, Output<String> id, WorkspaceState 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.
- Alias string
- The alias of the prometheus workspace. See more in AWS Docs.
- Arn string
- Amazon Resource Name (ARN) of the workspace.
- Kms
Key stringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- Logging
Configuration WorkspaceLogging Configuration - Logging configuration for the workspace. See Logging Configuration below for details.
- Prometheus
Endpoint string - Prometheus endpoint available for this workspace.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Alias string
- The alias of the prometheus workspace. See more in AWS Docs.
- Arn string
- Amazon Resource Name (ARN) of the workspace.
- Kms
Key stringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- Logging
Configuration WorkspaceLogging Configuration Args - Logging configuration for the workspace. See Logging Configuration below for details.
- Prometheus
Endpoint string - Prometheus endpoint available for this workspace.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- alias String
- The alias of the prometheus workspace. See more in AWS Docs.
- arn String
- Amazon Resource Name (ARN) of the workspace.
- kms
Key StringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- logging
Configuration WorkspaceLogging Configuration - Logging configuration for the workspace. See Logging Configuration below for details.
- prometheus
Endpoint String - Prometheus endpoint available for this workspace.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- alias string
- The alias of the prometheus workspace. See more in AWS Docs.
- arn string
- Amazon Resource Name (ARN) of the workspace.
- kms
Key stringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- logging
Configuration WorkspaceLogging Configuration - Logging configuration for the workspace. See Logging Configuration below for details.
- prometheus
Endpoint string - Prometheus endpoint available for this workspace.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- alias str
- The alias of the prometheus workspace. See more in AWS Docs.
- arn str
- Amazon Resource Name (ARN) of the workspace.
- kms_
key_ strarn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- logging_
configuration WorkspaceLogging Configuration Args - Logging configuration for the workspace. See Logging Configuration below for details.
- prometheus_
endpoint str - Prometheus endpoint available for this workspace.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- alias String
- The alias of the prometheus workspace. See more in AWS Docs.
- arn String
- Amazon Resource Name (ARN) of the workspace.
- kms
Key StringArn - The ARN for the KMS encryption key. If this argument is not provided, then the AWS owned encryption key will be used to encrypt the data in the workspace. See more in AWS Docs
- logging
Configuration Property Map - Logging configuration for the workspace. See Logging Configuration below for details.
- prometheus
Endpoint String - Prometheus endpoint available for this workspace.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Supporting Types
WorkspaceLoggingConfiguration, WorkspaceLoggingConfigurationArgs
- Log
Group stringArn - The ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist.
- Log
Group stringArn - The ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist.
- log
Group StringArn - The ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist.
- log
Group stringArn - The ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist.
- log_
group_ strarn - The ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist.
- log
Group StringArn - The ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist.
Import
Using pulumi import
, import AMP Workspaces using the identifier. For example:
$ pulumi import aws:amp/workspace:Workspace demo ws-C6DCB907-F2D7-4D96-957B-66691F865D8B
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.