Provides a resource to create a APM sample config
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.ApmInstance("example", {
name: "tf-example",
description: "desc.",
traceDuration: 7,
spanDailyCounters: 0,
tags: {
createdBy: "Terraform",
},
});
const exampleApmSampleConfig = new tencentcloud.ApmSampleConfig("example", {
instanceId: example.apmInstanceId,
sampleName: "tf-example",
sampleRate: 90,
serviceName: "java-order-serive",
operationType: 0,
tags: [{
key: "createdBy",
value: "Terraform",
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.ApmInstance("example",
name="tf-example",
description="desc.",
trace_duration=7,
span_daily_counters=0,
tags={
"createdBy": "Terraform",
})
example_apm_sample_config = tencentcloud.ApmSampleConfig("example",
instance_id=example.apm_instance_id,
sample_name="tf-example",
sample_rate=90,
service_name="java-order-serive",
operation_type=0,
tags=[{
"key": "createdBy",
"value": "Terraform",
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := tencentcloud.NewApmInstance(ctx, "example", &tencentcloud.ApmInstanceArgs{
Name: pulumi.String("tf-example"),
Description: pulumi.String("desc."),
TraceDuration: pulumi.Float64(7),
SpanDailyCounters: pulumi.Float64(0),
Tags: pulumi.StringMap{
"createdBy": pulumi.String("Terraform"),
},
})
if err != nil {
return err
}
_, err = tencentcloud.NewApmSampleConfig(ctx, "example", &tencentcloud.ApmSampleConfigArgs{
InstanceId: example.ApmInstanceId,
SampleName: pulumi.String("tf-example"),
SampleRate: pulumi.Float64(90),
ServiceName: pulumi.String("java-order-serive"),
OperationType: pulumi.Float64(0),
Tags: tencentcloud.ApmSampleConfigTagArray{
&tencentcloud.ApmSampleConfigTagArgs{
Key: pulumi.String("createdBy"),
Value: pulumi.String("Terraform"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.ApmInstance("example", new()
{
Name = "tf-example",
Description = "desc.",
TraceDuration = 7,
SpanDailyCounters = 0,
Tags =
{
{ "createdBy", "Terraform" },
},
});
var exampleApmSampleConfig = new Tencentcloud.ApmSampleConfig("example", new()
{
InstanceId = example.ApmInstanceId,
SampleName = "tf-example",
SampleRate = 90,
ServiceName = "java-order-serive",
OperationType = 0,
Tags = new[]
{
new Tencentcloud.Inputs.ApmSampleConfigTagArgs
{
Key = "createdBy",
Value = "Terraform",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ApmInstance;
import com.pulumi.tencentcloud.ApmInstanceArgs;
import com.pulumi.tencentcloud.ApmSampleConfig;
import com.pulumi.tencentcloud.ApmSampleConfigArgs;
import com.pulumi.tencentcloud.inputs.ApmSampleConfigTagArgs;
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 ApmInstance("example", ApmInstanceArgs.builder()
.name("tf-example")
.description("desc.")
.traceDuration(7.0)
.spanDailyCounters(0.0)
.tags(Map.of("createdBy", "Terraform"))
.build());
var exampleApmSampleConfig = new ApmSampleConfig("exampleApmSampleConfig", ApmSampleConfigArgs.builder()
.instanceId(example.apmInstanceId())
.sampleName("tf-example")
.sampleRate(90.0)
.serviceName("java-order-serive")
.operationType(0.0)
.tags(ApmSampleConfigTagArgs.builder()
.key("createdBy")
.value("Terraform")
.build())
.build());
}
}
resources:
example:
type: tencentcloud:ApmInstance
properties:
name: tf-example
description: desc.
traceDuration: 7
spanDailyCounters: 0
tags:
createdBy: Terraform
exampleApmSampleConfig:
type: tencentcloud:ApmSampleConfig
name: example
properties:
instanceId: ${example.apmInstanceId}
sampleName: tf-example
sampleRate: 90
serviceName: java-order-serive
operationType: 0
tags:
- key: createdBy
value: Terraform
Create ApmSampleConfig Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApmSampleConfig(name: string, args: ApmSampleConfigArgs, opts?: CustomResourceOptions);@overload
def ApmSampleConfig(resource_name: str,
args: ApmSampleConfigArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApmSampleConfig(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
sample_name: Optional[str] = None,
sample_rate: Optional[float] = None,
service_name: Optional[str] = None,
apm_sample_config_id: Optional[str] = None,
operation_name: Optional[str] = None,
operation_type: Optional[float] = None,
tags: Optional[Sequence[ApmSampleConfigTagArgs]] = None)func NewApmSampleConfig(ctx *Context, name string, args ApmSampleConfigArgs, opts ...ResourceOption) (*ApmSampleConfig, error)public ApmSampleConfig(string name, ApmSampleConfigArgs args, CustomResourceOptions? opts = null)
public ApmSampleConfig(String name, ApmSampleConfigArgs args)
public ApmSampleConfig(String name, ApmSampleConfigArgs args, CustomResourceOptions options)
type: tencentcloud:ApmSampleConfig
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 ApmSampleConfigArgs
- 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 ApmSampleConfigArgs
- 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 ApmSampleConfigArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApmSampleConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApmSampleConfigArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ApmSampleConfig 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 ApmSampleConfig resource accepts the following input properties:
- Instance
Id string - Business system ID.
- Sample
Name string - Sampling rule name.
- Sample
Rate double - Sampling rate.
- Service
Name string - Application name.
- Apm
Sample stringConfig Id - ID of the resource.
- Operation
Name string - API name.
- Operation
Type double - 0: exact match (default); 1: prefix match; 2: suffix match.
-
List<Apm
Sample Config Tag> - Sampling tags.
- Instance
Id string - Business system ID.
- Sample
Name string - Sampling rule name.
- Sample
Rate float64 - Sampling rate.
- Service
Name string - Application name.
- Apm
Sample stringConfig Id - ID of the resource.
- Operation
Name string - API name.
- Operation
Type float64 - 0: exact match (default); 1: prefix match; 2: suffix match.
-
[]Apm
Sample Config Tag Args - Sampling tags.
- instance
Id String - Business system ID.
- sample
Name String - Sampling rule name.
- sample
Rate Double - Sampling rate.
- service
Name String - Application name.
- apm
Sample StringConfig Id - ID of the resource.
- operation
Name String - API name.
- operation
Type Double - 0: exact match (default); 1: prefix match; 2: suffix match.
-
List<Apm
Sample Config Tag> - Sampling tags.
- instance
Id string - Business system ID.
- sample
Name string - Sampling rule name.
- sample
Rate number - Sampling rate.
- service
Name string - Application name.
- apm
Sample stringConfig Id - ID of the resource.
- operation
Name string - API name.
- operation
Type number - 0: exact match (default); 1: prefix match; 2: suffix match.
-
Apm
Sample Config Tag[] - Sampling tags.
- instance_
id str - Business system ID.
- sample_
name str - Sampling rule name.
- sample_
rate float - Sampling rate.
- service_
name str - Application name.
- apm_
sample_ strconfig_ id - ID of the resource.
- operation_
name str - API name.
- operation_
type float - 0: exact match (default); 1: prefix match; 2: suffix match.
-
Sequence[Apm
Sample Config Tag Args] - Sampling tags.
- instance
Id String - Business system ID.
- sample
Name String - Sampling rule name.
- sample
Rate Number - Sampling rate.
- service
Name String - Application name.
- apm
Sample StringConfig Id - ID of the resource.
- operation
Name String - API name.
- operation
Type Number - 0: exact match (default); 1: prefix match; 2: suffix match.
- List<Property Map>
- Sampling tags.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApmSampleConfig 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 ApmSampleConfig Resource
Get an existing ApmSampleConfig 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?: ApmSampleConfigState, opts?: CustomResourceOptions): ApmSampleConfig@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
apm_sample_config_id: Optional[str] = None,
instance_id: Optional[str] = None,
operation_name: Optional[str] = None,
operation_type: Optional[float] = None,
sample_name: Optional[str] = None,
sample_rate: Optional[float] = None,
service_name: Optional[str] = None,
tags: Optional[Sequence[ApmSampleConfigTagArgs]] = None) -> ApmSampleConfigfunc GetApmSampleConfig(ctx *Context, name string, id IDInput, state *ApmSampleConfigState, opts ...ResourceOption) (*ApmSampleConfig, error)public static ApmSampleConfig Get(string name, Input<string> id, ApmSampleConfigState? state, CustomResourceOptions? opts = null)public static ApmSampleConfig get(String name, Output<String> id, ApmSampleConfigState state, CustomResourceOptions options)resources: _: type: tencentcloud:ApmSampleConfig 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.
- Apm
Sample stringConfig Id - ID of the resource.
- Instance
Id string - Business system ID.
- Operation
Name string - API name.
- Operation
Type double - 0: exact match (default); 1: prefix match; 2: suffix match.
- Sample
Name string - Sampling rule name.
- Sample
Rate double - Sampling rate.
- Service
Name string - Application name.
-
List<Apm
Sample Config Tag> - Sampling tags.
- Apm
Sample stringConfig Id - ID of the resource.
- Instance
Id string - Business system ID.
- Operation
Name string - API name.
- Operation
Type float64 - 0: exact match (default); 1: prefix match; 2: suffix match.
- Sample
Name string - Sampling rule name.
- Sample
Rate float64 - Sampling rate.
- Service
Name string - Application name.
-
[]Apm
Sample Config Tag Args - Sampling tags.
- apm
Sample StringConfig Id - ID of the resource.
- instance
Id String - Business system ID.
- operation
Name String - API name.
- operation
Type Double - 0: exact match (default); 1: prefix match; 2: suffix match.
- sample
Name String - Sampling rule name.
- sample
Rate Double - Sampling rate.
- service
Name String - Application name.
-
List<Apm
Sample Config Tag> - Sampling tags.
- apm
Sample stringConfig Id - ID of the resource.
- instance
Id string - Business system ID.
- operation
Name string - API name.
- operation
Type number - 0: exact match (default); 1: prefix match; 2: suffix match.
- sample
Name string - Sampling rule name.
- sample
Rate number - Sampling rate.
- service
Name string - Application name.
-
Apm
Sample Config Tag[] - Sampling tags.
- apm_
sample_ strconfig_ id - ID of the resource.
- instance_
id str - Business system ID.
- operation_
name str - API name.
- operation_
type float - 0: exact match (default); 1: prefix match; 2: suffix match.
- sample_
name str - Sampling rule name.
- sample_
rate float - Sampling rate.
- service_
name str - Application name.
-
Sequence[Apm
Sample Config Tag Args] - Sampling tags.
- apm
Sample StringConfig Id - ID of the resource.
- instance
Id String - Business system ID.
- operation
Name String - API name.
- operation
Type Number - 0: exact match (default); 1: prefix match; 2: suffix match.
- sample
Name String - Sampling rule name.
- sample
Rate Number - Sampling rate.
- service
Name String - Application name.
- List<Property Map>
- Sampling tags.
Supporting Types
ApmSampleConfigTag, ApmSampleConfigTagArgs
Import
APM sample config can be imported using the instanceId#sampleName, e.g.
$ pulumi import tencentcloud:index/apmSampleConfig:ApmSampleConfig example apm-jPr5iQL77#tf-example
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
