Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.cen.getTrafficMarkingPolicies
Explore with Pulumi AI
This data source provides the Cen Traffic Marking Policies of the current Alibaba Cloud user.
NOTE: Available in v1.173.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.cen.getTrafficMarkingPolicies({
transitRouterId: "example_value",
ids: [
"example_value-1",
"example_value-2",
],
});
export const cenTrafficMarkingPolicyId1 = ids.then(ids => ids.policies?.[0]?.id);
const nameRegex = alicloud.cen.getTrafficMarkingPolicies({
transitRouterId: "example_value",
nameRegex: "^my-TrafficMarkingPolicy",
});
export const cenTrafficMarkingPolicyId2 = nameRegex.then(nameRegex => nameRegex.policies?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.cen.get_traffic_marking_policies(transit_router_id="example_value",
ids=[
"example_value-1",
"example_value-2",
])
pulumi.export("cenTrafficMarkingPolicyId1", ids.policies[0].id)
name_regex = alicloud.cen.get_traffic_marking_policies(transit_router_id="example_value",
name_regex="^my-TrafficMarkingPolicy")
pulumi.export("cenTrafficMarkingPolicyId2", name_regex.policies[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := cen.GetTrafficMarkingPolicies(ctx, &cen.GetTrafficMarkingPoliciesArgs{
TransitRouterId: "example_value",
Ids: []string{
"example_value-1",
"example_value-2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("cenTrafficMarkingPolicyId1", ids.Policies[0].Id)
nameRegex, err := cen.GetTrafficMarkingPolicies(ctx, &cen.GetTrafficMarkingPoliciesArgs{
TransitRouterId: "example_value",
NameRegex: pulumi.StringRef("^my-TrafficMarkingPolicy"),
}, nil)
if err != nil {
return err
}
ctx.Export("cenTrafficMarkingPolicyId2", nameRegex.Policies[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Cen.GetTrafficMarkingPolicies.Invoke(new()
{
TransitRouterId = "example_value",
Ids = new[]
{
"example_value-1",
"example_value-2",
},
});
var nameRegex = AliCloud.Cen.GetTrafficMarkingPolicies.Invoke(new()
{
TransitRouterId = "example_value",
NameRegex = "^my-TrafficMarkingPolicy",
});
return new Dictionary<string, object?>
{
["cenTrafficMarkingPolicyId1"] = ids.Apply(getTrafficMarkingPoliciesResult => getTrafficMarkingPoliciesResult.Policies[0]?.Id),
["cenTrafficMarkingPolicyId2"] = nameRegex.Apply(getTrafficMarkingPoliciesResult => getTrafficMarkingPoliciesResult.Policies[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cen.CenFunctions;
import com.pulumi.alicloud.cen.inputs.GetTrafficMarkingPoliciesArgs;
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 ids = CenFunctions.getTrafficMarkingPolicies(GetTrafficMarkingPoliciesArgs.builder()
.transitRouterId("example_value")
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("cenTrafficMarkingPolicyId1", ids.applyValue(getTrafficMarkingPoliciesResult -> getTrafficMarkingPoliciesResult.policies()[0].id()));
final var nameRegex = CenFunctions.getTrafficMarkingPolicies(GetTrafficMarkingPoliciesArgs.builder()
.transitRouterId("example_value")
.nameRegex("^my-TrafficMarkingPolicy")
.build());
ctx.export("cenTrafficMarkingPolicyId2", nameRegex.applyValue(getTrafficMarkingPoliciesResult -> getTrafficMarkingPoliciesResult.policies()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:cen:getTrafficMarkingPolicies
Arguments:
transitRouterId: example_value
ids:
- example_value-1
- example_value-2
nameRegex:
fn::invoke:
Function: alicloud:cen:getTrafficMarkingPolicies
Arguments:
transitRouterId: example_value
nameRegex: ^my-TrafficMarkingPolicy
outputs:
cenTrafficMarkingPolicyId1: ${ids.policies[0].id}
cenTrafficMarkingPolicyId2: ${nameRegex.policies[0].id}
Using getTrafficMarkingPolicies
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getTrafficMarkingPolicies(args: GetTrafficMarkingPoliciesArgs, opts?: InvokeOptions): Promise<GetTrafficMarkingPoliciesResult>
function getTrafficMarkingPoliciesOutput(args: GetTrafficMarkingPoliciesOutputArgs, opts?: InvokeOptions): Output<GetTrafficMarkingPoliciesResult>
def get_traffic_marking_policies(description: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
status: Optional[str] = None,
transit_router_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTrafficMarkingPoliciesResult
def get_traffic_marking_policies_output(description: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
transit_router_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetTrafficMarkingPoliciesResult]
func GetTrafficMarkingPolicies(ctx *Context, args *GetTrafficMarkingPoliciesArgs, opts ...InvokeOption) (*GetTrafficMarkingPoliciesResult, error)
func GetTrafficMarkingPoliciesOutput(ctx *Context, args *GetTrafficMarkingPoliciesOutputArgs, opts ...InvokeOption) GetTrafficMarkingPoliciesResultOutput
> Note: This function is named GetTrafficMarkingPolicies
in the Go SDK.
public static class GetTrafficMarkingPolicies
{
public static Task<GetTrafficMarkingPoliciesResult> InvokeAsync(GetTrafficMarkingPoliciesArgs args, InvokeOptions? opts = null)
public static Output<GetTrafficMarkingPoliciesResult> Invoke(GetTrafficMarkingPoliciesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTrafficMarkingPoliciesResult> getTrafficMarkingPolicies(GetTrafficMarkingPoliciesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:cen/getTrafficMarkingPolicies:getTrafficMarkingPolicies
arguments:
# arguments dictionary
The following arguments are supported:
- Transit
Router stringId - The ID of the transit router.
- Description string
- Ids List<string>
- A list of Traffic Marking Policy IDs.
- Name
Regex string - A regex string to filter results by Traffic Marking Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of the resource. Valid values:
Active
,Creating
,Deleting
,Updating
.
- Transit
Router stringId - The ID of the transit router.
- Description string
- Ids []string
- A list of Traffic Marking Policy IDs.
- Name
Regex string - A regex string to filter results by Traffic Marking Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of the resource. Valid values:
Active
,Creating
,Deleting
,Updating
.
- transit
Router StringId - The ID of the transit router.
- description String
- ids List<String>
- A list of Traffic Marking Policy IDs.
- name
Regex String - A regex string to filter results by Traffic Marking Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of the resource. Valid values:
Active
,Creating
,Deleting
,Updating
.
- transit
Router stringId - The ID of the transit router.
- description string
- ids string[]
- A list of Traffic Marking Policy IDs.
- name
Regex string - A regex string to filter results by Traffic Marking Policy name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - status string
- The status of the resource. Valid values:
Active
,Creating
,Deleting
,Updating
.
- transit_
router_ strid - The ID of the transit router.
- description str
- ids Sequence[str]
- A list of Traffic Marking Policy IDs.
- name_
regex str - A regex string to filter results by Traffic Marking Policy name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - status str
- The status of the resource. Valid values:
Active
,Creating
,Deleting
,Updating
.
- transit
Router StringId - The ID of the transit router.
- description String
- ids List<String>
- A list of Traffic Marking Policy IDs.
- name
Regex String - A regex string to filter results by Traffic Marking Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of the resource. Valid values:
Active
,Creating
,Deleting
,Updating
.
getTrafficMarkingPolicies Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Policies
List<Pulumi.
Ali Cloud. Cen. Outputs. Get Traffic Marking Policies Policy> - Transit
Router stringId - Description string
- Name
Regex string - Output
File string - Status string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Policies
[]Get
Traffic Marking Policies Policy - Transit
Router stringId - Description string
- Name
Regex string - Output
File string - Status string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- policies
List<Get
Traffic Marking Policies Policy> - transit
Router StringId - description String
- name
Regex String - output
File String - status String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- policies
Get
Traffic Marking Policies Policy[] - transit
Router stringId - description string
- name
Regex string - output
File string - status string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- policies
Sequence[Get
Traffic Marking Policies Policy] - transit_
router_ strid - description str
- name_
regex str - output_
file str - status str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- policies List<Property Map>
- transit
Router StringId - description String
- name
Regex String - output
File String - status String
Supporting Types
GetTrafficMarkingPoliciesPolicy
- Description string
- The description of the Traffic Marking Policy.
- Id string
- The ID of the resource. The value is formatted
<transit_router_id>:<traffic_marking_policy_id>
. - Marking
Dscp int - The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy.
- Priority int
- The Priority of the Traffic Marking Policy.
- Status string
- The status of the resource.
- Traffic
Marking stringPolicy Id - The ID of the Traffic Marking Policy.
- Traffic
Marking stringPolicy Name - The name of the Traffic Marking Policy.
- Transit
Router stringId - The ID of the transit router.
- Description string
- The description of the Traffic Marking Policy.
- Id string
- The ID of the resource. The value is formatted
<transit_router_id>:<traffic_marking_policy_id>
. - Marking
Dscp int - The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy.
- Priority int
- The Priority of the Traffic Marking Policy.
- Status string
- The status of the resource.
- Traffic
Marking stringPolicy Id - The ID of the Traffic Marking Policy.
- Traffic
Marking stringPolicy Name - The name of the Traffic Marking Policy.
- Transit
Router stringId - The ID of the transit router.
- description String
- The description of the Traffic Marking Policy.
- id String
- The ID of the resource. The value is formatted
<transit_router_id>:<traffic_marking_policy_id>
. - marking
Dscp Integer - The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy.
- priority Integer
- The Priority of the Traffic Marking Policy.
- status String
- The status of the resource.
- traffic
Marking StringPolicy Id - The ID of the Traffic Marking Policy.
- traffic
Marking StringPolicy Name - The name of the Traffic Marking Policy.
- transit
Router StringId - The ID of the transit router.
- description string
- The description of the Traffic Marking Policy.
- id string
- The ID of the resource. The value is formatted
<transit_router_id>:<traffic_marking_policy_id>
. - marking
Dscp number - The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy.
- priority number
- The Priority of the Traffic Marking Policy.
- status string
- The status of the resource.
- traffic
Marking stringPolicy Id - The ID of the Traffic Marking Policy.
- traffic
Marking stringPolicy Name - The name of the Traffic Marking Policy.
- transit
Router stringId - The ID of the transit router.
- description str
- The description of the Traffic Marking Policy.
- id str
- The ID of the resource. The value is formatted
<transit_router_id>:<traffic_marking_policy_id>
. - marking_
dscp int - The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy.
- priority int
- The Priority of the Traffic Marking Policy.
- status str
- The status of the resource.
- traffic_
marking_ strpolicy_ id - The ID of the Traffic Marking Policy.
- traffic_
marking_ strpolicy_ name - The name of the Traffic Marking Policy.
- transit_
router_ strid - The ID of the transit router.
- description String
- The description of the Traffic Marking Policy.
- id String
- The ID of the resource. The value is formatted
<transit_router_id>:<traffic_marking_policy_id>
. - marking
Dscp Number - The DSCP(Differentiated Services Code Point) of the Traffic Marking Policy.
- priority Number
- The Priority of the Traffic Marking Policy.
- status String
- The status of the resource.
- traffic
Marking StringPolicy Id - The ID of the Traffic Marking Policy.
- traffic
Marking StringPolicy Name - The name of the Traffic Marking Policy.
- transit
Router StringId - The ID of the transit router.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.