ec.DeploymentTrafficFilterAssociation
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ec from "@pulumi/ec";
const example = ec.getDeployment({
id: "320b7b540dfc967a7a649c18e2fce4ed",
});
const exampleDeploymentTrafficFilter = new ec.DeploymentTrafficFilter("example", {
name: "my traffic filter name",
region: "us-east-1",
type: "ip",
rules: [{
source: "0.0.0.0/0",
}],
});
const exampleDeploymentTrafficFilterAssociation = new ec.DeploymentTrafficFilterAssociation("example", {
trafficFilterId: exampleDeploymentTrafficFilter.id,
deploymentId: exampleEcDeployment.id,
});
import pulumi
import pulumi_ec as ec
example = ec.get_deployment(id="320b7b540dfc967a7a649c18e2fce4ed")
example_deployment_traffic_filter = ec.DeploymentTrafficFilter("example",
name="my traffic filter name",
region="us-east-1",
type="ip",
rules=[{
"source": "0.0.0.0/0",
}])
example_deployment_traffic_filter_association = ec.DeploymentTrafficFilterAssociation("example",
traffic_filter_id=example_deployment_traffic_filter.id,
deployment_id=example_ec_deployment["id"])
package main
import (
"github.com/pulumi/pulumi-ec/sdk/go/ec"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec.LookupDeployment(ctx, &ec.LookupDeploymentArgs{
Id: "320b7b540dfc967a7a649c18e2fce4ed",
}, nil)
if err != nil {
return err
}
exampleDeploymentTrafficFilter, err := ec.NewDeploymentTrafficFilter(ctx, "example", &ec.DeploymentTrafficFilterArgs{
Name: pulumi.String("my traffic filter name"),
Region: pulumi.String("us-east-1"),
Type: pulumi.String("ip"),
Rules: ec.DeploymentTrafficFilterRuleArray{
&ec.DeploymentTrafficFilterRuleArgs{
Source: pulumi.String("0.0.0.0/0"),
},
},
})
if err != nil {
return err
}
_, err = ec.NewDeploymentTrafficFilterAssociation(ctx, "example", &ec.DeploymentTrafficFilterAssociationArgs{
TrafficFilterId: exampleDeploymentTrafficFilter.ID(),
DeploymentId: pulumi.Any(exampleEcDeployment.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ElasticCloud = Pulumi.ElasticCloud;
return await Deployment.RunAsync(() =>
{
var example = ElasticCloud.GetDeployment.Invoke(new()
{
Id = "320b7b540dfc967a7a649c18e2fce4ed",
});
var exampleDeploymentTrafficFilter = new ElasticCloud.DeploymentTrafficFilter("example", new()
{
Name = "my traffic filter name",
Region = "us-east-1",
Type = "ip",
Rules = new[]
{
new ElasticCloud.Inputs.DeploymentTrafficFilterRuleArgs
{
Source = "0.0.0.0/0",
},
},
});
var exampleDeploymentTrafficFilterAssociation = new ElasticCloud.DeploymentTrafficFilterAssociation("example", new()
{
TrafficFilterId = exampleDeploymentTrafficFilter.Id,
DeploymentId = exampleEcDeployment.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ec.EcFunctions;
import com.pulumi.ec.inputs.GetDeploymentArgs;
import com.pulumi.ec.DeploymentTrafficFilter;
import com.pulumi.ec.DeploymentTrafficFilterArgs;
import com.pulumi.ec.inputs.DeploymentTrafficFilterRuleArgs;
import com.pulumi.ec.DeploymentTrafficFilterAssociation;
import com.pulumi.ec.DeploymentTrafficFilterAssociationArgs;
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 example = EcFunctions.getDeployment(GetDeploymentArgs.builder()
.id("320b7b540dfc967a7a649c18e2fce4ed")
.build());
var exampleDeploymentTrafficFilter = new DeploymentTrafficFilter("exampleDeploymentTrafficFilter", DeploymentTrafficFilterArgs.builder()
.name("my traffic filter name")
.region("us-east-1")
.type("ip")
.rules(DeploymentTrafficFilterRuleArgs.builder()
.source("0.0.0.0/0")
.build())
.build());
var exampleDeploymentTrafficFilterAssociation = new DeploymentTrafficFilterAssociation("exampleDeploymentTrafficFilterAssociation", DeploymentTrafficFilterAssociationArgs.builder()
.trafficFilterId(exampleDeploymentTrafficFilter.id())
.deploymentId(exampleEcDeployment.id())
.build());
}
}
resources:
exampleDeploymentTrafficFilter:
type: ec:DeploymentTrafficFilter
name: example
properties:
name: my traffic filter name
region: us-east-1
type: ip
rules:
- source: 0.0.0.0/0
exampleDeploymentTrafficFilterAssociation:
type: ec:DeploymentTrafficFilterAssociation
name: example
properties:
trafficFilterId: ${exampleDeploymentTrafficFilter.id}
deploymentId: ${exampleEcDeployment.id}
variables:
example:
fn::invoke:
Function: ec:getDeployment
Arguments:
id: 320b7b540dfc967a7a649c18e2fce4ed
Create DeploymentTrafficFilterAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DeploymentTrafficFilterAssociation(name: string, args: DeploymentTrafficFilterAssociationArgs, opts?: CustomResourceOptions);
@overload
def DeploymentTrafficFilterAssociation(resource_name: str,
args: DeploymentTrafficFilterAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DeploymentTrafficFilterAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
deployment_id: Optional[str] = None,
traffic_filter_id: Optional[str] = None)
func NewDeploymentTrafficFilterAssociation(ctx *Context, name string, args DeploymentTrafficFilterAssociationArgs, opts ...ResourceOption) (*DeploymentTrafficFilterAssociation, error)
public DeploymentTrafficFilterAssociation(string name, DeploymentTrafficFilterAssociationArgs args, CustomResourceOptions? opts = null)
public DeploymentTrafficFilterAssociation(String name, DeploymentTrafficFilterAssociationArgs args)
public DeploymentTrafficFilterAssociation(String name, DeploymentTrafficFilterAssociationArgs args, CustomResourceOptions options)
type: ec:DeploymentTrafficFilterAssociation
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 DeploymentTrafficFilterAssociationArgs
- 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 DeploymentTrafficFilterAssociationArgs
- 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 DeploymentTrafficFilterAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DeploymentTrafficFilterAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DeploymentTrafficFilterAssociationArgs
- 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 deploymentTrafficFilterAssociationResource = new ElasticCloud.DeploymentTrafficFilterAssociation("deploymentTrafficFilterAssociationResource", new()
{
DeploymentId = "string",
TrafficFilterId = "string",
});
example, err := ec.NewDeploymentTrafficFilterAssociation(ctx, "deploymentTrafficFilterAssociationResource", &ec.DeploymentTrafficFilterAssociationArgs{
DeploymentId: pulumi.String("string"),
TrafficFilterId: pulumi.String("string"),
})
var deploymentTrafficFilterAssociationResource = new DeploymentTrafficFilterAssociation("deploymentTrafficFilterAssociationResource", DeploymentTrafficFilterAssociationArgs.builder()
.deploymentId("string")
.trafficFilterId("string")
.build());
deployment_traffic_filter_association_resource = ec.DeploymentTrafficFilterAssociation("deploymentTrafficFilterAssociationResource",
deployment_id="string",
traffic_filter_id="string")
const deploymentTrafficFilterAssociationResource = new ec.DeploymentTrafficFilterAssociation("deploymentTrafficFilterAssociationResource", {
deploymentId: "string",
trafficFilterId: "string",
});
type: ec:DeploymentTrafficFilterAssociation
properties:
deploymentId: string
trafficFilterId: string
DeploymentTrafficFilterAssociation 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 DeploymentTrafficFilterAssociation resource accepts the following input properties:
- Deployment
Id string - Required deployment ID where the traffic filter will be associated
- Traffic
Filter stringId - Required traffic filter ruleset ID to tie to a deployment
- Deployment
Id string - Required deployment ID where the traffic filter will be associated
- Traffic
Filter stringId - Required traffic filter ruleset ID to tie to a deployment
- deployment
Id String - Required deployment ID where the traffic filter will be associated
- traffic
Filter StringId - Required traffic filter ruleset ID to tie to a deployment
- deployment
Id string - Required deployment ID where the traffic filter will be associated
- traffic
Filter stringId - Required traffic filter ruleset ID to tie to a deployment
- deployment_
id str - Required deployment ID where the traffic filter will be associated
- traffic_
filter_ strid - Required traffic filter ruleset ID to tie to a deployment
- deployment
Id String - Required deployment ID where the traffic filter will be associated
- traffic
Filter StringId - Required traffic filter ruleset ID to tie to a deployment
Outputs
All input properties are implicitly available as output properties. Additionally, the DeploymentTrafficFilterAssociation 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 DeploymentTrafficFilterAssociation Resource
Get an existing DeploymentTrafficFilterAssociation 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?: DeploymentTrafficFilterAssociationState, opts?: CustomResourceOptions): DeploymentTrafficFilterAssociation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
deployment_id: Optional[str] = None,
traffic_filter_id: Optional[str] = None) -> DeploymentTrafficFilterAssociation
func GetDeploymentTrafficFilterAssociation(ctx *Context, name string, id IDInput, state *DeploymentTrafficFilterAssociationState, opts ...ResourceOption) (*DeploymentTrafficFilterAssociation, error)
public static DeploymentTrafficFilterAssociation Get(string name, Input<string> id, DeploymentTrafficFilterAssociationState? state, CustomResourceOptions? opts = null)
public static DeploymentTrafficFilterAssociation get(String name, Output<String> id, DeploymentTrafficFilterAssociationState 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.
- Deployment
Id string - Required deployment ID where the traffic filter will be associated
- Traffic
Filter stringId - Required traffic filter ruleset ID to tie to a deployment
- Deployment
Id string - Required deployment ID where the traffic filter will be associated
- Traffic
Filter stringId - Required traffic filter ruleset ID to tie to a deployment
- deployment
Id String - Required deployment ID where the traffic filter will be associated
- traffic
Filter StringId - Required traffic filter ruleset ID to tie to a deployment
- deployment
Id string - Required deployment ID where the traffic filter will be associated
- traffic
Filter stringId - Required traffic filter ruleset ID to tie to a deployment
- deployment_
id str - Required deployment ID where the traffic filter will be associated
- traffic_
filter_ strid - Required traffic filter ruleset ID to tie to a deployment
- deployment
Id String - Required deployment ID where the traffic filter will be associated
- traffic
Filter StringId - Required traffic filter ruleset ID to tie to a deployment
Import
Import is not supported on this resource
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ec pulumi/pulumi-ec
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ec
Terraform Provider.