alicloud.eventbridge.ApiDestination
Explore with Pulumi AI
Provides a Event Bridge Api Destination resource.
For information about Event Bridge Api Destination and how to use it, see What is Api Destination.
NOTE: Available since v1.211.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const region = config.get("region") || "cn-chengdu";
const name = config.get("name") || "terraform-example";
const _default = new alicloud.eventbridge.Connection("default", {
connectionName: name,
networkParameters: {
networkType: "PublicNetwork",
},
});
const defaultApiDestination = new alicloud.eventbridge.ApiDestination("default", {
connectionName: _default.connectionName,
apiDestinationName: name,
description: "test-api-destination-connection",
httpApiParameters: {
endpoint: "http://127.0.0.1:8001",
method: "POST",
},
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
region = config.get("region")
if region is None:
region = "cn-chengdu"
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.eventbridge.Connection("default",
connection_name=name,
network_parameters=alicloud.eventbridge.ConnectionNetworkParametersArgs(
network_type="PublicNetwork",
))
default_api_destination = alicloud.eventbridge.ApiDestination("default",
connection_name=default.connection_name,
api_destination_name=name,
description="test-api-destination-connection",
http_api_parameters=alicloud.eventbridge.ApiDestinationHttpApiParametersArgs(
endpoint="http://127.0.0.1:8001",
method="POST",
))
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eventbridge"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
region := "cn-chengdu"
if param := cfg.Get("region"); param != "" {
region = param
}
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := eventbridge.NewConnection(ctx, "default", &eventbridge.ConnectionArgs{
ConnectionName: pulumi.String(name),
NetworkParameters: &eventbridge.ConnectionNetworkParametersArgs{
NetworkType: pulumi.String("PublicNetwork"),
},
})
if err != nil {
return err
}
_, err = eventbridge.NewApiDestination(ctx, "default", &eventbridge.ApiDestinationArgs{
ConnectionName: _default.ConnectionName,
ApiDestinationName: pulumi.String(name),
Description: pulumi.String("test-api-destination-connection"),
HttpApiParameters: &eventbridge.ApiDestinationHttpApiParametersArgs{
Endpoint: pulumi.String("http://127.0.0.1:8001"),
Method: pulumi.String("POST"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var region = config.Get("region") ?? "cn-chengdu";
var name = config.Get("name") ?? "terraform-example";
var @default = new AliCloud.EventBridge.Connection("default", new()
{
ConnectionName = name,
NetworkParameters = new AliCloud.EventBridge.Inputs.ConnectionNetworkParametersArgs
{
NetworkType = "PublicNetwork",
},
});
var defaultApiDestination = new AliCloud.EventBridge.ApiDestination("default", new()
{
ConnectionName = @default.ConnectionName,
ApiDestinationName = name,
Description = "test-api-destination-connection",
HttpApiParameters = new AliCloud.EventBridge.Inputs.ApiDestinationHttpApiParametersArgs
{
Endpoint = "http://127.0.0.1:8001",
Method = "POST",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.eventbridge.Connection;
import com.pulumi.alicloud.eventbridge.ConnectionArgs;
import com.pulumi.alicloud.eventbridge.inputs.ConnectionNetworkParametersArgs;
import com.pulumi.alicloud.eventbridge.ApiDestination;
import com.pulumi.alicloud.eventbridge.ApiDestinationArgs;
import com.pulumi.alicloud.eventbridge.inputs.ApiDestinationHttpApiParametersArgs;
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 config = ctx.config();
final var region = config.get("region").orElse("cn-chengdu");
final var name = config.get("name").orElse("terraform-example");
var default_ = new Connection("default", ConnectionArgs.builder()
.connectionName(name)
.networkParameters(ConnectionNetworkParametersArgs.builder()
.networkType("PublicNetwork")
.build())
.build());
var defaultApiDestination = new ApiDestination("defaultApiDestination", ApiDestinationArgs.builder()
.connectionName(default_.connectionName())
.apiDestinationName(name)
.description("test-api-destination-connection")
.httpApiParameters(ApiDestinationHttpApiParametersArgs.builder()
.endpoint("http://127.0.0.1:8001")
.method("POST")
.build())
.build());
}
}
configuration:
region:
type: string
default: cn-chengdu
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:eventbridge:Connection
properties:
connectionName: ${name}
networkParameters:
networkType: PublicNetwork
defaultApiDestination:
type: alicloud:eventbridge:ApiDestination
name: default
properties:
connectionName: ${default.connectionName}
apiDestinationName: ${name}
description: test-api-destination-connection
httpApiParameters:
endpoint: http://127.0.0.1:8001
method: POST
Create ApiDestination Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiDestination(name: string, args: ApiDestinationArgs, opts?: CustomResourceOptions);
@overload
def ApiDestination(resource_name: str,
args: ApiDestinationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiDestination(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_destination_name: Optional[str] = None,
connection_name: Optional[str] = None,
http_api_parameters: Optional[ApiDestinationHttpApiParametersArgs] = None,
description: Optional[str] = None)
func NewApiDestination(ctx *Context, name string, args ApiDestinationArgs, opts ...ResourceOption) (*ApiDestination, error)
public ApiDestination(string name, ApiDestinationArgs args, CustomResourceOptions? opts = null)
public ApiDestination(String name, ApiDestinationArgs args)
public ApiDestination(String name, ApiDestinationArgs args, CustomResourceOptions options)
type: alicloud:eventbridge:ApiDestination
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 ApiDestinationArgs
- 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 ApiDestinationArgs
- 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 ApiDestinationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiDestinationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiDestinationArgs
- 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 apiDestinationResource = new AliCloud.EventBridge.ApiDestination("apiDestinationResource", new()
{
ApiDestinationName = "string",
ConnectionName = "string",
HttpApiParameters = new AliCloud.EventBridge.Inputs.ApiDestinationHttpApiParametersArgs
{
Endpoint = "string",
Method = "string",
},
Description = "string",
});
example, err := eventbridge.NewApiDestination(ctx, "apiDestinationResource", &eventbridge.ApiDestinationArgs{
ApiDestinationName: pulumi.String("string"),
ConnectionName: pulumi.String("string"),
HttpApiParameters: &eventbridge.ApiDestinationHttpApiParametersArgs{
Endpoint: pulumi.String("string"),
Method: pulumi.String("string"),
},
Description: pulumi.String("string"),
})
var apiDestinationResource = new ApiDestination("apiDestinationResource", ApiDestinationArgs.builder()
.apiDestinationName("string")
.connectionName("string")
.httpApiParameters(ApiDestinationHttpApiParametersArgs.builder()
.endpoint("string")
.method("string")
.build())
.description("string")
.build());
api_destination_resource = alicloud.eventbridge.ApiDestination("apiDestinationResource",
api_destination_name="string",
connection_name="string",
http_api_parameters=alicloud.eventbridge.ApiDestinationHttpApiParametersArgs(
endpoint="string",
method="string",
),
description="string")
const apiDestinationResource = new alicloud.eventbridge.ApiDestination("apiDestinationResource", {
apiDestinationName: "string",
connectionName: "string",
httpApiParameters: {
endpoint: "string",
method: "string",
},
description: "string",
});
type: alicloud:eventbridge:ApiDestination
properties:
apiDestinationName: string
connectionName: string
description: string
httpApiParameters:
endpoint: string
method: string
ApiDestination Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ApiDestination resource accepts the following input properties:
- Api
Destination stringName - The name of the API destination.
- Connection
Name string - The name of the connection.
- Http
Api Pulumi.Parameters Ali Cloud. Event Bridge. Inputs. Api Destination Http Api Parameters - The parameters that are configured for the API destination. See
http_api_parameters
below. - Description string
- The description of the API destination.
- Api
Destination stringName - The name of the API destination.
- Connection
Name string - The name of the connection.
- Http
Api ApiParameters Destination Http Api Parameters Args - The parameters that are configured for the API destination. See
http_api_parameters
below. - Description string
- The description of the API destination.
- api
Destination StringName - The name of the API destination.
- connection
Name String - The name of the connection.
- http
Api ApiParameters Destination Http Api Parameters - The parameters that are configured for the API destination. See
http_api_parameters
below. - description String
- The description of the API destination.
- api
Destination stringName - The name of the API destination.
- connection
Name string - The name of the connection.
- http
Api ApiParameters Destination Http Api Parameters - The parameters that are configured for the API destination. See
http_api_parameters
below. - description string
- The description of the API destination.
- api_
destination_ strname - The name of the API destination.
- connection_
name str - The name of the connection.
- http_
api_ Apiparameters Destination Http Api Parameters Args - The parameters that are configured for the API destination. See
http_api_parameters
below. - description str
- The description of the API destination.
- api
Destination StringName - The name of the API destination.
- connection
Name String - The name of the connection.
- http
Api Property MapParameters - The parameters that are configured for the API destination. See
http_api_parameters
below. - description String
- The description of the API destination.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiDestination resource produces the following output properties:
- Create
Time int - The creation time of the Api Destination.
- Id string
- The provider-assigned unique ID for this managed resource.
- Create
Time int - The creation time of the Api Destination.
- Id string
- The provider-assigned unique ID for this managed resource.
- create
Time Integer - The creation time of the Api Destination.
- id String
- The provider-assigned unique ID for this managed resource.
- create
Time number - The creation time of the Api Destination.
- id string
- The provider-assigned unique ID for this managed resource.
- create_
time int - The creation time of the Api Destination.
- id str
- The provider-assigned unique ID for this managed resource.
- create
Time Number - The creation time of the Api Destination.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ApiDestination Resource
Get an existing ApiDestination 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?: ApiDestinationState, opts?: CustomResourceOptions): ApiDestination
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_destination_name: Optional[str] = None,
connection_name: Optional[str] = None,
create_time: Optional[int] = None,
description: Optional[str] = None,
http_api_parameters: Optional[ApiDestinationHttpApiParametersArgs] = None) -> ApiDestination
func GetApiDestination(ctx *Context, name string, id IDInput, state *ApiDestinationState, opts ...ResourceOption) (*ApiDestination, error)
public static ApiDestination Get(string name, Input<string> id, ApiDestinationState? state, CustomResourceOptions? opts = null)
public static ApiDestination get(String name, Output<String> id, ApiDestinationState 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.
- Api
Destination stringName - The name of the API destination.
- Connection
Name string - The name of the connection.
- Create
Time int - The creation time of the Api Destination.
- Description string
- The description of the API destination.
- Http
Api Pulumi.Parameters Ali Cloud. Event Bridge. Inputs. Api Destination Http Api Parameters - The parameters that are configured for the API destination. See
http_api_parameters
below.
- Api
Destination stringName - The name of the API destination.
- Connection
Name string - The name of the connection.
- Create
Time int - The creation time of the Api Destination.
- Description string
- The description of the API destination.
- Http
Api ApiParameters Destination Http Api Parameters Args - The parameters that are configured for the API destination. See
http_api_parameters
below.
- api
Destination StringName - The name of the API destination.
- connection
Name String - The name of the connection.
- create
Time Integer - The creation time of the Api Destination.
- description String
- The description of the API destination.
- http
Api ApiParameters Destination Http Api Parameters - The parameters that are configured for the API destination. See
http_api_parameters
below.
- api
Destination stringName - The name of the API destination.
- connection
Name string - The name of the connection.
- create
Time number - The creation time of the Api Destination.
- description string
- The description of the API destination.
- http
Api ApiParameters Destination Http Api Parameters - The parameters that are configured for the API destination. See
http_api_parameters
below.
- api_
destination_ strname - The name of the API destination.
- connection_
name str - The name of the connection.
- create_
time int - The creation time of the Api Destination.
- description str
- The description of the API destination.
- http_
api_ Apiparameters Destination Http Api Parameters Args - The parameters that are configured for the API destination. See
http_api_parameters
below.
- api
Destination StringName - The name of the API destination.
- connection
Name String - The name of the connection.
- create
Time Number - The creation time of the Api Destination.
- description String
- The description of the API destination.
- http
Api Property MapParameters - The parameters that are configured for the API destination. See
http_api_parameters
below.
Supporting Types
ApiDestinationHttpApiParameters, ApiDestinationHttpApiParametersArgs
Import
Event Bridge Api Destination can be imported using the id, e.g.
$ pulumi import alicloud:eventbridge/apiDestination:ApiDestination example <id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.