wavefront.MetricsPolicy
Explore with Pulumi AI
Provides a Wavefront Metrics Policy Resource. This allows management of Metrics Policy to control access to time series, histograms, and delta counters
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as wavefront from "@pulumi/wavefront";
const everyone = wavefront.getDefaultUserGroup({});
const main = new wavefront.MetricsPolicy("main", {policyRules: [{
name: "Allow All Metrics",
description: "Predefined policy rule. Allows access to all metrics (timeseries, histograms, and counters) for all accounts. If this rule is removed, all accounts can access all metrics if there are no matching blocking rules.",
prefixes: ["*"],
tagsAnded: false,
accessType: "ALLOW",
userGroupIds: [everyone.then(everyone => everyone.groupId)],
}]});
import pulumi
import pulumi_wavefront as wavefront
everyone = wavefront.get_default_user_group()
main = wavefront.MetricsPolicy("main", policy_rules=[{
"name": "Allow All Metrics",
"description": "Predefined policy rule. Allows access to all metrics (timeseries, histograms, and counters) for all accounts. If this rule is removed, all accounts can access all metrics if there are no matching blocking rules.",
"prefixes": ["*"],
"tags_anded": False,
"access_type": "ALLOW",
"user_group_ids": [everyone.group_id],
}])
package main
import (
"github.com/pulumi/pulumi-wavefront/sdk/v3/go/wavefront"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
everyone, err := wavefront.GetDefaultUserGroup(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
_, err = wavefront.NewMetricsPolicy(ctx, "main", &wavefront.MetricsPolicyArgs{
PolicyRules: wavefront.MetricsPolicyPolicyRuleArray{
&wavefront.MetricsPolicyPolicyRuleArgs{
Name: pulumi.String("Allow All Metrics"),
Description: pulumi.String("Predefined policy rule. Allows access to all metrics (timeseries, histograms, and counters) for all accounts. If this rule is removed, all accounts can access all metrics if there are no matching blocking rules."),
Prefixes: pulumi.StringArray{
pulumi.String("*"),
},
TagsAnded: pulumi.Bool(false),
AccessType: pulumi.String("ALLOW"),
UserGroupIds: pulumi.StringArray{
pulumi.String(everyone.GroupId),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Wavefront = Pulumi.Wavefront;
return await Deployment.RunAsync(() =>
{
var everyone = Wavefront.GetDefaultUserGroup.Invoke();
var main = new Wavefront.MetricsPolicy("main", new()
{
PolicyRules = new[]
{
new Wavefront.Inputs.MetricsPolicyPolicyRuleArgs
{
Name = "Allow All Metrics",
Description = "Predefined policy rule. Allows access to all metrics (timeseries, histograms, and counters) for all accounts. If this rule is removed, all accounts can access all metrics if there are no matching blocking rules.",
Prefixes = new[]
{
"*",
},
TagsAnded = false,
AccessType = "ALLOW",
UserGroupIds = new[]
{
everyone.Apply(getDefaultUserGroupResult => getDefaultUserGroupResult.GroupId),
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.wavefront.WavefrontFunctions;
import com.pulumi.wavefront.MetricsPolicy;
import com.pulumi.wavefront.MetricsPolicyArgs;
import com.pulumi.wavefront.inputs.MetricsPolicyPolicyRuleArgs;
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) {
final var everyone = WavefrontFunctions.getDefaultUserGroup();
var main = new MetricsPolicy("main", MetricsPolicyArgs.builder()
.policyRules(MetricsPolicyPolicyRuleArgs.builder()
.name("Allow All Metrics")
.description("Predefined policy rule. Allows access to all metrics (timeseries, histograms, and counters) for all accounts. If this rule is removed, all accounts can access all metrics if there are no matching blocking rules.")
.prefixes("*")
.tagsAnded(false)
.accessType("ALLOW")
.userGroupIds(everyone.applyValue(getDefaultUserGroupResult -> getDefaultUserGroupResult.groupId()))
.build())
.build());
}
}
resources:
main:
type: wavefront:MetricsPolicy
properties:
policyRules:
- name: Allow All Metrics
description: Predefined policy rule. Allows access to all metrics (timeseries, histograms, and counters) for all accounts. If this rule is removed, all accounts can access all metrics if there are no matching blocking rules.
prefixes:
- '*'
tagsAnded: false
accessType: ALLOW
userGroupIds:
- ${everyone.groupId}
variables:
everyone:
fn::invoke:
Function: wavefront:getDefaultUserGroup
Arguments: {}
Data Source
Provides a Wavefront Metrics Policy Data Source. This allows looking up the current policy and associated rules.
Example
import * as pulumi from "@pulumi/pulumi";
import * as wavefront from "@pulumi/wavefront";
export = async () => {
const policy = await wavefront.getMetricsPolicy({});
return {
policy: policy,
};
}
import pulumi
import pulumi_wavefront as wavefront
policy = wavefront.get_metrics_policy()
pulumi.export("policy", policy)
package main
import (
"github.com/pulumi/pulumi-wavefront/sdk/v3/go/wavefront"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
policy, err := wavefront.LookupMetricsPolicy(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
ctx.Export("policy", policy)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Wavefront = Pulumi.Wavefront;
return await Deployment.RunAsync(() =>
{
var policy = Wavefront.GetMetricsPolicy.Invoke();
return new Dictionary<string, object?>
{
["policy"] = policy,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.wavefront.WavefrontFunctions;
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) {
final var policy = WavefrontFunctions.getMetricsPolicy();
ctx.export("policy", policy.applyValue(getMetricsPolicyResult -> getMetricsPolicyResult));
}
}
variables:
policy:
fn::invoke:
Function: wavefront:getMetricsPolicy
Arguments: {}
outputs:
policy: ${policy}
Create MetricsPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MetricsPolicy(name: string, args: MetricsPolicyArgs, opts?: CustomResourceOptions);
@overload
def MetricsPolicy(resource_name: str,
args: MetricsPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MetricsPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
policy_rules: Optional[Sequence[MetricsPolicyPolicyRuleArgs]] = None)
func NewMetricsPolicy(ctx *Context, name string, args MetricsPolicyArgs, opts ...ResourceOption) (*MetricsPolicy, error)
public MetricsPolicy(string name, MetricsPolicyArgs args, CustomResourceOptions? opts = null)
public MetricsPolicy(String name, MetricsPolicyArgs args)
public MetricsPolicy(String name, MetricsPolicyArgs args, CustomResourceOptions options)
type: wavefront:MetricsPolicy
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 MetricsPolicyArgs
- 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 MetricsPolicyArgs
- 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 MetricsPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MetricsPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MetricsPolicyArgs
- 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 metricsPolicyResource = new Wavefront.MetricsPolicy("metricsPolicyResource", new()
{
PolicyRules = new[]
{
new Wavefront.Inputs.MetricsPolicyPolicyRuleArgs
{
AccessType = "string",
Description = "string",
Name = "string",
Prefixes = new[]
{
"string",
},
TagsAnded = false,
AccountIds = new[]
{
"string",
},
RoleIds = new[]
{
"string",
},
Tags = new[]
{
new Wavefront.Inputs.MetricsPolicyPolicyRuleTagArgs
{
Key = "string",
Value = "string",
},
},
UserGroupIds = new[]
{
"string",
},
},
},
});
example, err := wavefront.NewMetricsPolicy(ctx, "metricsPolicyResource", &wavefront.MetricsPolicyArgs{
PolicyRules: wavefront.MetricsPolicyPolicyRuleArray{
&wavefront.MetricsPolicyPolicyRuleArgs{
AccessType: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Prefixes: pulumi.StringArray{
pulumi.String("string"),
},
TagsAnded: pulumi.Bool(false),
AccountIds: pulumi.StringArray{
pulumi.String("string"),
},
RoleIds: pulumi.StringArray{
pulumi.String("string"),
},
Tags: wavefront.MetricsPolicyPolicyRuleTagArray{
&wavefront.MetricsPolicyPolicyRuleTagArgs{
Key: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
UserGroupIds: pulumi.StringArray{
pulumi.String("string"),
},
},
},
})
var metricsPolicyResource = new MetricsPolicy("metricsPolicyResource", MetricsPolicyArgs.builder()
.policyRules(MetricsPolicyPolicyRuleArgs.builder()
.accessType("string")
.description("string")
.name("string")
.prefixes("string")
.tagsAnded(false)
.accountIds("string")
.roleIds("string")
.tags(MetricsPolicyPolicyRuleTagArgs.builder()
.key("string")
.value("string")
.build())
.userGroupIds("string")
.build())
.build());
metrics_policy_resource = wavefront.MetricsPolicy("metricsPolicyResource", policy_rules=[{
"access_type": "string",
"description": "string",
"name": "string",
"prefixes": ["string"],
"tags_anded": False,
"account_ids": ["string"],
"role_ids": ["string"],
"tags": [{
"key": "string",
"value": "string",
}],
"user_group_ids": ["string"],
}])
const metricsPolicyResource = new wavefront.MetricsPolicy("metricsPolicyResource", {policyRules: [{
accessType: "string",
description: "string",
name: "string",
prefixes: ["string"],
tagsAnded: false,
accountIds: ["string"],
roleIds: ["string"],
tags: [{
key: "string",
value: "string",
}],
userGroupIds: ["string"],
}]});
type: wavefront:MetricsPolicy
properties:
policyRules:
- accessType: string
accountIds:
- string
description: string
name: string
prefixes:
- string
roleIds:
- string
tags:
- key: string
value: string
tagsAnded: false
userGroupIds:
- string
MetricsPolicy 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 MetricsPolicy resource accepts the following input properties:
- Policy
Rules List<MetricsPolicy Policy Rule> - List of Metrics Policies, must have at least one entry.
- Policy
Rules []MetricsPolicy Policy Rule Args - List of Metrics Policies, must have at least one entry.
- policy
Rules List<MetricsPolicy Policy Rule> - List of Metrics Policies, must have at least one entry.
- policy
Rules MetricsPolicy Policy Rule[] - List of Metrics Policies, must have at least one entry.
- policy_
rules Sequence[MetricsPolicy Policy Rule Args] - List of Metrics Policies, must have at least one entry.
- policy
Rules List<Property Map> - List of Metrics Policies, must have at least one entry.
Outputs
All input properties are implicitly available as output properties. Additionally, the MetricsPolicy resource produces the following output properties:
- Customer string
- The customer the user is associated with.
- Id string
- The provider-assigned unique ID for this managed resource.
- Updated
Epoch intMillis - When the policy was applied in epoch_millis.
- Updater
Id string - The account_id who applied the current policy.
- Customer string
- The customer the user is associated with.
- Id string
- The provider-assigned unique ID for this managed resource.
- Updated
Epoch intMillis - When the policy was applied in epoch_millis.
- Updater
Id string - The account_id who applied the current policy.
- customer String
- The customer the user is associated with.
- id String
- The provider-assigned unique ID for this managed resource.
- updated
Epoch IntegerMillis - When the policy was applied in epoch_millis.
- updater
Id String - The account_id who applied the current policy.
- customer string
- The customer the user is associated with.
- id string
- The provider-assigned unique ID for this managed resource.
- updated
Epoch numberMillis - When the policy was applied in epoch_millis.
- updater
Id string - The account_id who applied the current policy.
- customer str
- The customer the user is associated with.
- id str
- The provider-assigned unique ID for this managed resource.
- updated_
epoch_ intmillis - When the policy was applied in epoch_millis.
- updater_
id str - The account_id who applied the current policy.
- customer String
- The customer the user is associated with.
- id String
- The provider-assigned unique ID for this managed resource.
- updated
Epoch NumberMillis - When the policy was applied in epoch_millis.
- updater
Id String - The account_id who applied the current policy.
Look up Existing MetricsPolicy Resource
Get an existing MetricsPolicy 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?: MetricsPolicyState, opts?: CustomResourceOptions): MetricsPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
customer: Optional[str] = None,
policy_rules: Optional[Sequence[MetricsPolicyPolicyRuleArgs]] = None,
updated_epoch_millis: Optional[int] = None,
updater_id: Optional[str] = None) -> MetricsPolicy
func GetMetricsPolicy(ctx *Context, name string, id IDInput, state *MetricsPolicyState, opts ...ResourceOption) (*MetricsPolicy, error)
public static MetricsPolicy Get(string name, Input<string> id, MetricsPolicyState? state, CustomResourceOptions? opts = null)
public static MetricsPolicy get(String name, Output<String> id, MetricsPolicyState 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.
- Customer string
- The customer the user is associated with.
- Policy
Rules List<MetricsPolicy Policy Rule> - List of Metrics Policies, must have at least one entry.
- Updated
Epoch intMillis - When the policy was applied in epoch_millis.
- Updater
Id string - The account_id who applied the current policy.
- Customer string
- The customer the user is associated with.
- Policy
Rules []MetricsPolicy Policy Rule Args - List of Metrics Policies, must have at least one entry.
- Updated
Epoch intMillis - When the policy was applied in epoch_millis.
- Updater
Id string - The account_id who applied the current policy.
- customer String
- The customer the user is associated with.
- policy
Rules List<MetricsPolicy Policy Rule> - List of Metrics Policies, must have at least one entry.
- updated
Epoch IntegerMillis - When the policy was applied in epoch_millis.
- updater
Id String - The account_id who applied the current policy.
- customer string
- The customer the user is associated with.
- policy
Rules MetricsPolicy Policy Rule[] - List of Metrics Policies, must have at least one entry.
- updated
Epoch numberMillis - When the policy was applied in epoch_millis.
- updater
Id string - The account_id who applied the current policy.
- customer str
- The customer the user is associated with.
- policy_
rules Sequence[MetricsPolicy Policy Rule Args] - List of Metrics Policies, must have at least one entry.
- updated_
epoch_ intmillis - When the policy was applied in epoch_millis.
- updater_
id str - The account_id who applied the current policy.
- customer String
- The customer the user is associated with.
- policy
Rules List<Property Map> - List of Metrics Policies, must have at least one entry.
- updated
Epoch NumberMillis - When the policy was applied in epoch_millis.
- updater
Id String - The account_id who applied the current policy.
Supporting Types
MetricsPolicyPolicyRule, MetricsPolicyPolicyRuleArgs
- Access
Type string - Valid options are
ALLOW
andBLOCK
. - Description string
- A detailed description of the Metrics Policy. The description is visible only when you edit the rule.
- Name string
- The unique name identifier for a Metrics Policy. The name is visible on the Metrics Security Policy page.
- Prefixes List<string>
- List of prefixes to match metrics on. You can specify the full metric name or use a wildcard character in metric names, sources, or point tags. The wildcard character alone (*) means all metrics.
- bool
- Bool where
true
require all tags are met by selected metrics, elsefalse
select metrics that match any give tag. - Account
Ids List<string> - List of account ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- Role
Ids List<string> - List of role ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- List<Metrics
Policy Policy Rule Tag> - List of Key/Value tags to select target metrics for policy.
- User
Group List<string>Ids - List of user group ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- Access
Type string - Valid options are
ALLOW
andBLOCK
. - Description string
- A detailed description of the Metrics Policy. The description is visible only when you edit the rule.
- Name string
- The unique name identifier for a Metrics Policy. The name is visible on the Metrics Security Policy page.
- Prefixes []string
- List of prefixes to match metrics on. You can specify the full metric name or use a wildcard character in metric names, sources, or point tags. The wildcard character alone (*) means all metrics.
- bool
- Bool where
true
require all tags are met by selected metrics, elsefalse
select metrics that match any give tag. - Account
Ids []string - List of account ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- Role
Ids []string - List of role ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- []Metrics
Policy Policy Rule Tag - List of Key/Value tags to select target metrics for policy.
- User
Group []stringIds - List of user group ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- access
Type String - Valid options are
ALLOW
andBLOCK
. - description String
- A detailed description of the Metrics Policy. The description is visible only when you edit the rule.
- name String
- The unique name identifier for a Metrics Policy. The name is visible on the Metrics Security Policy page.
- prefixes List<String>
- List of prefixes to match metrics on. You can specify the full metric name or use a wildcard character in metric names, sources, or point tags. The wildcard character alone (*) means all metrics.
- Boolean
- Bool where
true
require all tags are met by selected metrics, elsefalse
select metrics that match any give tag. - account
Ids List<String> - List of account ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- role
Ids List<String> - List of role ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- List<Metrics
Policy Policy Rule Tag> - List of Key/Value tags to select target metrics for policy.
- user
Group List<String>Ids - List of user group ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- access
Type string - Valid options are
ALLOW
andBLOCK
. - description string
- A detailed description of the Metrics Policy. The description is visible only when you edit the rule.
- name string
- The unique name identifier for a Metrics Policy. The name is visible on the Metrics Security Policy page.
- prefixes string[]
- List of prefixes to match metrics on. You can specify the full metric name or use a wildcard character in metric names, sources, or point tags. The wildcard character alone (*) means all metrics.
- boolean
- Bool where
true
require all tags are met by selected metrics, elsefalse
select metrics that match any give tag. - account
Ids string[] - List of account ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- role
Ids string[] - List of role ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- Metrics
Policy Policy Rule Tag[] - List of Key/Value tags to select target metrics for policy.
- user
Group string[]Ids - List of user group ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- access_
type str - Valid options are
ALLOW
andBLOCK
. - description str
- A detailed description of the Metrics Policy. The description is visible only when you edit the rule.
- name str
- The unique name identifier for a Metrics Policy. The name is visible on the Metrics Security Policy page.
- prefixes Sequence[str]
- List of prefixes to match metrics on. You can specify the full metric name or use a wildcard character in metric names, sources, or point tags. The wildcard character alone (*) means all metrics.
- bool
- Bool where
true
require all tags are met by selected metrics, elsefalse
select metrics that match any give tag. - account_
ids Sequence[str] - List of account ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- role_
ids Sequence[str] - List of role ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- Sequence[Metrics
Policy Policy Rule Tag] - List of Key/Value tags to select target metrics for policy.
- user_
group_ Sequence[str]ids - List of user group ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- access
Type String - Valid options are
ALLOW
andBLOCK
. - description String
- A detailed description of the Metrics Policy. The description is visible only when you edit the rule.
- name String
- The unique name identifier for a Metrics Policy. The name is visible on the Metrics Security Policy page.
- prefixes List<String>
- List of prefixes to match metrics on. You can specify the full metric name or use a wildcard character in metric names, sources, or point tags. The wildcard character alone (*) means all metrics.
- Boolean
- Bool where
true
require all tags are met by selected metrics, elsefalse
select metrics that match any give tag. - account
Ids List<String> - List of account ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- role
Ids List<String> - List of role ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
- List<Property Map>
- List of Key/Value tags to select target metrics for policy.
- user
Group List<String>Ids - List of user group ids to apply Metrics Policy to. Must have at least one associated account_id, user_group_id, or role_id.
MetricsPolicyPolicyRuleTag, MetricsPolicyPolicyRuleTagArgs
Import
Users can be imported by using the updated_epoch_millis
, e.g.:
$ pulumi import wavefront:index/metricsPolicy:MetricsPolicy some_metrics_policy 1651846476678
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Wavefront pulumi/pulumi-wavefront
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
wavefront
Terraform Provider.