heroku.drain.Drain
Explore with Pulumi AI
Provides a Heroku Drain resource. This can be used to create and manage Log Drains on Heroku.
Example Usage
resource "heroku_app" "foobar" {
name = "foobar"
region = "us"
}
resource "heroku_drain" "default" {
app_id = heroku_app.foobar.id
url = "syslog://terraform.example.com:1234"
}
resource "heroku_app" "foobar" {
name = "foobar"
region = "us"
}
resource "heroku_drain" "default" {
app_id = heroku_app.foobar.id
sensitive_url = "https://user:pass@terraform.example.com"
}
Create Drain Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Drain(name: string, args: DrainArgs, opts?: CustomResourceOptions);
@overload
def Drain(resource_name: str,
args: DrainArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Drain(resource_name: str,
opts: Optional[ResourceOptions] = None,
app_id: Optional[str] = None,
sensitive_url: Optional[str] = None,
url: Optional[str] = None)
func NewDrain(ctx *Context, name string, args DrainArgs, opts ...ResourceOption) (*Drain, error)
public Drain(string name, DrainArgs args, CustomResourceOptions? opts = null)
type: heroku:drain:Drain
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 DrainArgs
- 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 DrainArgs
- 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 DrainArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DrainArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DrainArgs
- 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 drainResource = new Heroku.Drain.Drain("drainResource", new()
{
AppId = "string",
SensitiveUrl = "string",
Url = "string",
});
example, err := drain.NewDrain(ctx, "drainResource", &drain.DrainArgs{
AppId: pulumi.String("string"),
SensitiveUrl: pulumi.String("string"),
Url: pulumi.String("string"),
})
var drainResource = new Drain("drainResource", DrainArgs.builder()
.appId("string")
.sensitiveUrl("string")
.url("string")
.build());
drain_resource = heroku.drain.Drain("drainResource",
app_id="string",
sensitive_url="string",
url="string")
const drainResource = new heroku.drain.Drain("drainResource", {
appId: "string",
sensitiveUrl: "string",
url: "string",
});
type: heroku:drain:Drain
properties:
appId: string
sensitiveUrl: string
url: string
Drain 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 Drain resource accepts the following input properties:
- App
Id string - Heroku app ID (do not use app name)
- Sensitive
Url string - Url string
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- App
Id string - Heroku app ID (do not use app name)
- Sensitive
Url string - Url string
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- app
Id String - Heroku app ID (do not use app name)
- sensitive
Url String - url String
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- app
Id string - Heroku app ID (do not use app name)
- sensitive
Url string - url string
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- app_
id str - Heroku app ID (do not use app name)
- sensitive_
url str - url str
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- app
Id String - Heroku app ID (do not use app name)
- sensitive
Url String - url String
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
Outputs
All input properties are implicitly available as output properties. Additionally, the Drain resource produces the following output properties:
Look up Existing Drain Resource
Get an existing Drain 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?: DrainState, opts?: CustomResourceOptions): Drain
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
app_id: Optional[str] = None,
sensitive_url: Optional[str] = None,
token: Optional[str] = None,
url: Optional[str] = None) -> Drain
func GetDrain(ctx *Context, name string, id IDInput, state *DrainState, opts ...ResourceOption) (*Drain, error)
public static Drain Get(string name, Input<string> id, DrainState? state, CustomResourceOptions? opts = null)
public static Drain get(String name, Output<String> id, DrainState state, CustomResourceOptions options)
resources: _: type: heroku:drain:Drain 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.
- App
Id string - Heroku app ID (do not use app name)
- Sensitive
Url string - Token string
- The unique token for your created drain.
- Url string
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- App
Id string - Heroku app ID (do not use app name)
- Sensitive
Url string - Token string
- The unique token for your created drain.
- Url string
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- app
Id String - Heroku app ID (do not use app name)
- sensitive
Url String - token String
- The unique token for your created drain.
- url String
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- app
Id string - Heroku app ID (do not use app name)
- sensitive
Url string - token string
- The unique token for your created drain.
- url string
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- app_
id str - Heroku app ID (do not use app name)
- sensitive_
url str - token str
- The unique token for your created drain.
- url str
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
- app
Id String - Heroku app ID (do not use app name)
- sensitive
Url String - token String
- The unique token for your created drain.
- url String
- The URL for Heroku to drain your logs to. Either
url
orsensitive_url
must be defined.
Import
ing
When importing a Heroku drain resource, the ID must be built using the app name colon the unique ID from the Heroku API.
For an app named production-api
with a drain ID of b85d9224-310b-409b-891e-c903f5a40568
and the url
attribute value
defined for the resource, you would import it as:
$ terraform import heroku_drain.production_api production-api:b85d9224-310b-409b-891e-c903f5a40568
When importing a Heroku drain resource, the ID must be built using the app name colon the unique ID from the Heroku API.
For an app named production-api
with a drain ID of b85d9224-310b-409b-891e-c903f5a40568
and the sensitive_url
attribute value
defined for the resource, you would import it as:
$ terraform import heroku_drain.production_api production-api:b85d9224-310b-409b-891e-c903f5a40568:sensitive
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- heroku pulumiverse/pulumi-heroku
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
heroku
Terraform Provider.