diff --git a/.ci-mgmt.yaml b/.ci-mgmt.yaml index cb060b5a..0a73493c 100644 --- a/.ci-mgmt.yaml +++ b/.ci-mgmt.yaml @@ -4,6 +4,11 @@ env: MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} makeTemplate: bridged plugins: + - name: terraform + version: "1.0.16" + kind: converter + - name: aws version: "4.0.0" team: ecosystem +pulumiConvert: 1 diff --git a/Makefile b/Makefile index f2288607..6dc6a91d 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ VERSION := $(shell pulumictl get version) JAVA_GEN := pulumi-java-gen TESTPARALLELISM := 10 WORKING_DIR := $(shell pwd) -PULUMI_CONVERT := 0 +PULUMI_CONVERT := 1 development: install_plugins provider build_sdks install_sdks @@ -111,6 +111,7 @@ install_nodejs_sdk: install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) install_plugins: .pulumi/bin/pulumi + .pulumi/bin/pulumi plugin install converter terraform 1.0.16 .pulumi/bin/pulumi plugin install resource aws 4.0.0 lint_provider: provider diff --git a/provider/cmd/pulumi-resource-mailgun/schema.json b/provider/cmd/pulumi-resource-mailgun/schema.json index 8e437404..937c376a 100644 --- a/provider/cmd/pulumi-resource-mailgun/schema.json +++ b/provider/cmd/pulumi-resource-mailgun/schema.json @@ -368,7 +368,7 @@ }, "resources": { "mailgun:index/domain:Domain": { - "description": "Provides a Mailgun App resource. This can be used to\ncreate and manage applications on Mailgun.\n\nAfter DNS records are set, domain verification should be triggered manually using [PUT /domains/\\\u003cdomain\\\u003e/verify](https://documentation.mailgun.com/en/latest/api-domains.html#domains)\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mailgun from \"@pulumi/mailgun\";\n\n// Create a new Mailgun domain\nconst _default = new mailgun.Domain(\"default\", {\n dkimKeySize: 1024,\n region: \"us\",\n smtpPassword: \"supersecretpassword1234\",\n spamAction: \"disabled\",\n});\n```\n```python\nimport pulumi\nimport pulumi_mailgun as mailgun\n\n# Create a new Mailgun domain\ndefault = mailgun.Domain(\"default\",\n dkim_key_size=1024,\n region=\"us\",\n smtp_password=\"supersecretpassword1234\",\n spam_action=\"disabled\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mailgun = Pulumi.Mailgun;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create a new Mailgun domain\n var @default = new Mailgun.Domain(\"default\", new()\n {\n DkimKeySize = 1024,\n Region = \"us\",\n SmtpPassword = \"supersecretpassword1234\",\n SpamAction = \"disabled\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Create a new Mailgun domain\n\t\t_, err := mailgun.NewDomain(ctx, \"default\", \u0026mailgun.DomainArgs{\n\t\t\tDkimKeySize: pulumi.Int(1024),\n\t\t\tRegion: pulumi.String(\"us\"),\n\t\t\tSmtpPassword: pulumi.String(\"supersecretpassword1234\"),\n\t\t\tSpamAction: pulumi.String(\"disabled\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.Domain;\nimport com.pulumi.mailgun.DomainArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Create a new Mailgun domain\n var default_ = new Domain(\"default\", DomainArgs.builder() \n .dkimKeySize(1024)\n .region(\"us\")\n .smtpPassword(\"supersecretpassword1234\")\n .spamAction(\"disabled\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create a new Mailgun domain\n default:\n type: mailgun:Domain\n properties:\n dkimKeySize: 1024\n region: us\n smtpPassword: supersecretpassword1234\n spamAction: disabled\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nDomains can be imported using `region:domain_name` via `import` command. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). \n\nhcl\n\n```sh\n$ pulumi import mailgun:index/domain:Domain test us:example.domain.com\n```\n\n", + "description": "Provides a Mailgun App resource. This can be used to\ncreate and manage applications on Mailgun.\n\nAfter DNS records are set, domain verification should be triggered manually using [PUT /domains/\\\u003cdomain\\\u003e/verify](https://documentation.mailgun.com/en/latest/api-domains.html#domains)\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mailgun from \"@pulumi/mailgun\";\n\n// Create a new Mailgun domain\nconst _default = new mailgun.Domain(\"default\", {\n name: \"test.example.com\",\n region: \"us\",\n spamAction: \"disabled\",\n smtpPassword: \"supersecretpassword1234\",\n dkimKeySize: 1024,\n});\n```\n```python\nimport pulumi\nimport pulumi_mailgun as mailgun\n\n# Create a new Mailgun domain\ndefault = mailgun.Domain(\"default\",\n name=\"test.example.com\",\n region=\"us\",\n spam_action=\"disabled\",\n smtp_password=\"supersecretpassword1234\",\n dkim_key_size=1024)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mailgun = Pulumi.Mailgun;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create a new Mailgun domain\n var @default = new Mailgun.Domain(\"default\", new()\n {\n Name = \"test.example.com\",\n Region = \"us\",\n SpamAction = \"disabled\",\n SmtpPassword = \"supersecretpassword1234\",\n DkimKeySize = 1024,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Create a new Mailgun domain\n\t\t_, err := mailgun.NewDomain(ctx, \"default\", \u0026mailgun.DomainArgs{\n\t\t\tName: pulumi.String(\"test.example.com\"),\n\t\t\tRegion: pulumi.String(\"us\"),\n\t\t\tSpamAction: pulumi.String(\"disabled\"),\n\t\t\tSmtpPassword: pulumi.String(\"supersecretpassword1234\"),\n\t\t\tDkimKeySize: pulumi.Int(1024),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.Domain;\nimport com.pulumi.mailgun.DomainArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Create a new Mailgun domain\n var default_ = new Domain(\"default\", DomainArgs.builder() \n .name(\"test.example.com\")\n .region(\"us\")\n .spamAction(\"disabled\")\n .smtpPassword(\"supersecretpassword1234\")\n .dkimKeySize(1024)\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create a new Mailgun domain\n default:\n type: mailgun:Domain\n properties:\n name: test.example.com\n region: us\n spamAction: disabled\n smtpPassword: supersecretpassword1234\n dkimKeySize: 1024\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nDomains can be imported using `region:domain_name` via `import` command. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). \n\nhcl\n\n```sh\n$ pulumi import mailgun:index/domain:Domain test us:example.domain.com\n```\n\n", "properties": { "dkimKeySize": { "type": "integer", @@ -582,7 +582,7 @@ } }, "mailgun:index/domainCredential:DomainCredential": { - "description": "Provides a Mailgun domain credential resource. This can be used to create and manage credential in domain of Mailgun.\n\n\u003e **Note:** Please note that starting of v0.6.1 due to using new Mailgun Client API (v4), there is no possibility to retrieve previously created secrets via API. In order get it worked, it's recommended to mark `password` as ignored under `lifecycle` block. See below.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.DomainCredential;\nimport com.pulumi.mailgun.DomainCredentialArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Create a new Mailgun credential\n var foobar = new DomainCredential(\"foobar\", DomainCredentialArgs.builder() \n .domain(\"toto.com\")\n .lifecycle(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))\n .login(\"test\")\n .password(\"supersecretpassword1234\")\n .region(\"us\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create a new Mailgun credential\n foobar:\n type: mailgun:DomainCredential\n properties:\n domain: toto.com\n lifecycle:\n ignoreChanges:\n - password\n login: test\n password: supersecretpassword1234\n region: us\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nDomain credential can be imported using `region:email` via `import` command. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). \n\nPassword is always exported to `null`.\n\nhcl\n\n```sh\n$ pulumi import mailgun:index/domainCredential:DomainCredential test us:test@domain.com\n```\n\n", + "description": "Provides a Mailgun domain credential resource. This can be used to create and manage credential in domain of Mailgun.\n\n\u003e **Note:** Please note that starting of v0.6.1 due to using new Mailgun Client API (v4), there is no possibility to retrieve previously created secrets via API. In order get it worked, it's recommended to mark `password` as ignored under `lifecycle` block. See below.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mailgun from \"@pulumi/mailgun\";\n\n// Create a new Mailgun credential\nconst foobar = new mailgun.DomainCredential(\"foobar\", {\n domain: \"toto.com\",\n login: \"test\",\n password: \"supersecretpassword1234\",\n region: \"us\",\n});\n```\n```python\nimport pulumi\nimport pulumi_mailgun as mailgun\n\n# Create a new Mailgun credential\nfoobar = mailgun.DomainCredential(\"foobar\",\n domain=\"toto.com\",\n login=\"test\",\n password=\"supersecretpassword1234\",\n region=\"us\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mailgun = Pulumi.Mailgun;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create a new Mailgun credential\n var foobar = new Mailgun.DomainCredential(\"foobar\", new()\n {\n Domain = \"toto.com\",\n Login = \"test\",\n Password = \"supersecretpassword1234\",\n Region = \"us\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Create a new Mailgun credential\n\t\t_, err := mailgun.NewDomainCredential(ctx, \"foobar\", \u0026mailgun.DomainCredentialArgs{\n\t\t\tDomain: pulumi.String(\"toto.com\"),\n\t\t\tLogin: pulumi.String(\"test\"),\n\t\t\tPassword: pulumi.String(\"supersecretpassword1234\"),\n\t\t\tRegion: pulumi.String(\"us\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.DomainCredential;\nimport com.pulumi.mailgun.DomainCredentialArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Create a new Mailgun credential\n var foobar = new DomainCredential(\"foobar\", DomainCredentialArgs.builder() \n .domain(\"toto.com\")\n .login(\"test\")\n .password(\"supersecretpassword1234\")\n .region(\"us\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create a new Mailgun credential\n foobar:\n type: mailgun:DomainCredential\n properties:\n domain: toto.com\n login: test\n password: supersecretpassword1234\n region: us\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nDomain credential can be imported using `region:email` via `import` command. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). \n\nPassword is always exported to `null`.\n\nhcl\n\n```sh\n$ pulumi import mailgun:index/domainCredential:DomainCredential test us:test@domain.com\n```\n\n", "properties": { "domain": { "type": "string", @@ -662,7 +662,7 @@ } }, "mailgun:index/route:Route": { - "description": "Provides a Mailgun Route resource. This can be used to create and manage routes on Mailgun.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mailgun from \"@pulumi/mailgun\";\n\n// Create a new Mailgun route\nconst _default = new mailgun.Route(\"default\", {\n actions: [\n \"forward('http://example.com/api/v1/foos/')\",\n \"stop()\",\n ],\n description: \"inbound\",\n expression: \"match_recipient('.*@foo.example.com')\",\n priority: 0,\n});\n```\n```python\nimport pulumi\nimport pulumi_mailgun as mailgun\n\n# Create a new Mailgun route\ndefault = mailgun.Route(\"default\",\n actions=[\n \"forward('http://example.com/api/v1/foos/')\",\n \"stop()\",\n ],\n description=\"inbound\",\n expression=\"match_recipient('.*@foo.example.com')\",\n priority=0)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mailgun = Pulumi.Mailgun;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create a new Mailgun route\n var @default = new Mailgun.Route(\"default\", new()\n {\n Actions = new[]\n {\n \"forward('http://example.com/api/v1/foos/')\",\n \"stop()\",\n },\n Description = \"inbound\",\n Expression = \"match_recipient('.*@foo.example.com')\",\n Priority = 0,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Create a new Mailgun route\n\t\t_, err := mailgun.NewRoute(ctx, \"default\", \u0026mailgun.RouteArgs{\n\t\t\tActions: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"forward('http://example.com/api/v1/foos/')\"),\n\t\t\t\tpulumi.String(\"stop()\"),\n\t\t\t},\n\t\t\tDescription: pulumi.String(\"inbound\"),\n\t\t\tExpression: pulumi.String(\"match_recipient('.*@foo.example.com')\"),\n\t\t\tPriority: pulumi.Int(0),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.Route;\nimport com.pulumi.mailgun.RouteArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Create a new Mailgun route\n var default_ = new Route(\"default\", RouteArgs.builder() \n .actions( \n \"forward('http://example.com/api/v1/foos/')\",\n \"stop()\")\n .description(\"inbound\")\n .expression(\"match_recipient('.*@foo.example.com')\")\n .priority(\"0\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create a new Mailgun route\n default:\n type: mailgun:Route\n properties:\n actions:\n - forward('http://example.com/api/v1/foos/')\n - stop()\n description: inbound\n expression: match_recipient('.*@foo.example.com')\n priority: '0'\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRoutes can be imported using `ROUTE_ID` and `region` via `import` command. Route ID can be found on Mailgun portal in section `Receiving/Routes`. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). \n\nhcl\n\n```sh\n$ pulumi import mailgun:index/route:Route test eu:123456789\n```\n\n", + "description": "Provides a Mailgun Route resource. This can be used to create and manage routes on Mailgun.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mailgun from \"@pulumi/mailgun\";\n\n// Create a new Mailgun route\nconst _default = new mailgun.Route(\"default\", {\n priority: 0,\n description: \"inbound\",\n expression: \"match_recipient('.*@foo.example.com')\",\n actions: [\n \"forward('http://example.com/api/v1/foos/')\",\n \"stop()\",\n ],\n});\n```\n```python\nimport pulumi\nimport pulumi_mailgun as mailgun\n\n# Create a new Mailgun route\ndefault = mailgun.Route(\"default\",\n priority=0,\n description=\"inbound\",\n expression=\"match_recipient('.*@foo.example.com')\",\n actions=[\n \"forward('http://example.com/api/v1/foos/')\",\n \"stop()\",\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mailgun = Pulumi.Mailgun;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create a new Mailgun route\n var @default = new Mailgun.Route(\"default\", new()\n {\n Priority = 0,\n Description = \"inbound\",\n Expression = \"match_recipient('.*@foo.example.com')\",\n Actions = new[]\n {\n \"forward('http://example.com/api/v1/foos/')\",\n \"stop()\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Create a new Mailgun route\n\t\t_, err := mailgun.NewRoute(ctx, \"default\", \u0026mailgun.RouteArgs{\n\t\t\tPriority: pulumi.Int(0),\n\t\t\tDescription: pulumi.String(\"inbound\"),\n\t\t\tExpression: pulumi.String(\"match_recipient('.*@foo.example.com')\"),\n\t\t\tActions: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"forward('http://example.com/api/v1/foos/')\"),\n\t\t\t\tpulumi.String(\"stop()\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.Route;\nimport com.pulumi.mailgun.RouteArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Create a new Mailgun route\n var default_ = new Route(\"default\", RouteArgs.builder() \n .priority(\"0\")\n .description(\"inbound\")\n .expression(\"match_recipient('.*@foo.example.com')\")\n .actions( \n \"forward('http://example.com/api/v1/foos/')\",\n \"stop()\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create a new Mailgun route\n default:\n type: mailgun:Route\n properties:\n priority: '0'\n description: inbound\n expression: match_recipient('.*@foo.example.com')\n actions:\n - forward('http://example.com/api/v1/foos/')\n - stop()\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nRoutes can be imported using `ROUTE_ID` and `region` via `import` command. Route ID can be found on Mailgun portal in section `Receiving/Routes`. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). \n\nhcl\n\n```sh\n$ pulumi import mailgun:index/route:Route test eu:123456789\n```\n\n", "properties": { "actions": { "type": "array", @@ -750,7 +750,7 @@ } }, "mailgun:index/webhook:Webhook": { - "description": "Provides a Mailgun App resource. This can be used to\ncreate and manage applications on Mailgun.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mailgun from \"@pulumi/mailgun\";\n\n// Create a new Mailgun webhook\nconst _default = new mailgun.Webhook(\"default\", {\n domain: \"test.example.com\",\n kind: \"delivered\",\n region: \"us\",\n urls: [\"https://example.com\"],\n});\n```\n```python\nimport pulumi\nimport pulumi_mailgun as mailgun\n\n# Create a new Mailgun webhook\ndefault = mailgun.Webhook(\"default\",\n domain=\"test.example.com\",\n kind=\"delivered\",\n region=\"us\",\n urls=[\"https://example.com\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mailgun = Pulumi.Mailgun;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create a new Mailgun webhook\n var @default = new Mailgun.Webhook(\"default\", new()\n {\n Domain = \"test.example.com\",\n Kind = \"delivered\",\n Region = \"us\",\n Urls = new[]\n {\n \"https://example.com\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Create a new Mailgun webhook\n\t\t_, err := mailgun.NewWebhook(ctx, \"default\", \u0026mailgun.WebhookArgs{\n\t\t\tDomain: pulumi.String(\"test.example.com\"),\n\t\t\tKind: pulumi.String(\"delivered\"),\n\t\t\tRegion: pulumi.String(\"us\"),\n\t\t\tUrls: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"https://example.com\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.Webhook;\nimport com.pulumi.mailgun.WebhookArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Create a new Mailgun webhook\n var default_ = new Webhook(\"default\", WebhookArgs.builder() \n .domain(\"test.example.com\")\n .kind(\"delivered\")\n .region(\"us\")\n .urls(\"https://example.com\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create a new Mailgun webhook\n default:\n type: mailgun:Webhook\n properties:\n domain: test.example.com\n kind: delivered\n region: us\n urls:\n - https://example.com\n```\n\u003c!--End PulumiCodeChooser --\u003e\n", + "description": "Provides a Mailgun App resource. This can be used to\ncreate and manage applications on Mailgun.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mailgun from \"@pulumi/mailgun\";\n\n// Create a new Mailgun webhook\nconst _default = new mailgun.Webhook(\"default\", {\n domain: \"test.example.com\",\n region: \"us\",\n kind: \"delivered\",\n urls: [\"https://example.com\"],\n});\n```\n```python\nimport pulumi\nimport pulumi_mailgun as mailgun\n\n# Create a new Mailgun webhook\ndefault = mailgun.Webhook(\"default\",\n domain=\"test.example.com\",\n region=\"us\",\n kind=\"delivered\",\n urls=[\"https://example.com\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mailgun = Pulumi.Mailgun;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create a new Mailgun webhook\n var @default = new Mailgun.Webhook(\"default\", new()\n {\n Domain = \"test.example.com\",\n Region = \"us\",\n Kind = \"delivered\",\n Urls = new[]\n {\n \"https://example.com\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Create a new Mailgun webhook\n\t\t_, err := mailgun.NewWebhook(ctx, \"default\", \u0026mailgun.WebhookArgs{\n\t\t\tDomain: pulumi.String(\"test.example.com\"),\n\t\t\tRegion: pulumi.String(\"us\"),\n\t\t\tKind: pulumi.String(\"delivered\"),\n\t\t\tUrls: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"https://example.com\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.Webhook;\nimport com.pulumi.mailgun.WebhookArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n // Create a new Mailgun webhook\n var default_ = new Webhook(\"default\", WebhookArgs.builder() \n .domain(\"test.example.com\")\n .region(\"us\")\n .kind(\"delivered\")\n .urls(\"https://example.com\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create a new Mailgun webhook\n default:\n type: mailgun:Webhook\n properties:\n domain: test.example.com\n region: us\n kind: delivered\n urls:\n - https://example.com\n```\n\u003c!--End PulumiCodeChooser --\u003e\n", "properties": { "domain": { "type": "string", @@ -838,7 +838,7 @@ }, "functions": { "mailgun:index/getDomain:getDomain": { - "description": "`mailgun.Domain` provides details about a Mailgun domain.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as mailgun from \"@pulumi/mailgun\";\n\nconst domain = mailgun.getDomain({\n name: \"test.example.com\",\n});\nconst mailgun_mx = new aws.route53.Record(\"mailgun-mx\", {\n name: data.mailgun.domain.name,\n records: [\n Promise.all([domain, domain]).then(([domain, domain1]) =\u003e `${domain.receivingRecords?.[0]?.priority} ${domain1.receivingRecords?.[0]?.value}.`),\n Promise.all([domain, domain]).then(([domain, domain1]) =\u003e `${domain.receivingRecords?.[1]?.priority} ${domain1.receivingRecords?.[1]?.value}.`),\n ],\n ttl: 3600,\n type: aws.route53.RecordType.MX,\n zoneId: _var.zone_id,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_mailgun as mailgun\n\ndomain = mailgun.get_domain(name=\"test.example.com\")\nmailgun_mx = aws.route53.Record(\"mailgun-mx\",\n name=data[\"mailgun\"][\"domain\"][\"name\"],\n records=[\n f\"{domain.receiving_records[0].priority} {domain.receiving_records[0].value}.\",\n f\"{domain.receiving_records[1].priority} {domain.receiving_records[1].value}.\",\n ],\n ttl=3600,\n type=aws.route53.RecordType.MX,\n zone_id=var[\"zone_id\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Mailgun = Pulumi.Mailgun;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var domain = Mailgun.GetDomain.Invoke(new()\n {\n Name = \"test.example.com\",\n });\n\n var mailgun_mx = new Aws.Route53.Record(\"mailgun-mx\", new()\n {\n Name = data.Mailgun.Domain.Name,\n Records = new[]\n {\n Output.Tuple(domain, domain).Apply(values =\u003e\n {\n var domain = values.Item1;\n var domain1 = values.Item2;\n return $\"{domain.Apply(getDomainResult =\u003e getDomainResult.ReceivingRecords[0]?.Priority)} {domain1.ReceivingRecords[0]?.Value}.\";\n }),\n Output.Tuple(domain, domain).Apply(values =\u003e\n {\n var domain = values.Item1;\n var domain1 = values.Item2;\n return $\"{domain.Apply(getDomainResult =\u003e getDomainResult.ReceivingRecords[1]?.Priority)} {domain1.ReceivingRecords[1]?.Value}.\";\n }),\n },\n Ttl = 3600,\n Type = Aws.Route53.RecordType.MX,\n ZoneId = @var.Zone_id,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53\"\n\t\"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tdomain, err := mailgun.LookupDomain(ctx, \u0026mailgun.LookupDomainArgs{\n\t\t\tName: \"test.example.com\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = route53.NewRecord(ctx, \"mailgun-mx\", \u0026route53.RecordArgs{\n\t\t\tName: pulumi.Any(data.Mailgun.Domain.Name),\n\t\t\tRecords: pulumi.StringArray{\n\t\t\t\tpulumi.String(fmt.Sprintf(\"%v %v.\", domain.ReceivingRecords[0].Priority, domain.ReceivingRecords[0].Value)),\n\t\t\t\tpulumi.String(fmt.Sprintf(\"%v %v.\", domain.ReceivingRecords[1].Priority, domain.ReceivingRecords[1].Value)),\n\t\t\t},\n\t\t\tTtl: pulumi.Int(3600),\n\t\t\tType: pulumi.String(route53.RecordTypeMX),\n\t\t\tZoneId: pulumi.Any(_var.Zone_id),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.MailgunFunctions;\nimport com.pulumi.mailgun.inputs.GetDomainArgs;\nimport com.pulumi.aws.route53.Record;\nimport com.pulumi.aws.route53.RecordArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var domain = MailgunFunctions.getDomain(GetDomainArgs.builder()\n .name(\"test.example.com\")\n .build());\n\n var mailgun_mx = new Record(\"mailgun-mx\", RecordArgs.builder() \n .name(data.mailgun().domain().name())\n .records( \n String.format(\"%s %s.\", domain.applyValue(getDomainResult -\u003e getDomainResult.receivingRecords()[0].priority()),domain.applyValue(getDomainResult -\u003e getDomainResult.receivingRecords()[0].value())),\n String.format(\"%s %s.\", domain.applyValue(getDomainResult -\u003e getDomainResult.receivingRecords()[1].priority()),domain.applyValue(getDomainResult -\u003e getDomainResult.receivingRecords()[1].value())))\n .ttl(3600)\n .type(\"MX\")\n .zoneId(var_.zone_id())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n mailgun-mx:\n type: aws:route53:Record\n properties:\n name: ${data.mailgun.domain.name}\n records:\n - ${domain.receivingRecords[0].priority} ${domain.receivingRecords[0].value}.\n - ${domain.receivingRecords[1].priority} ${domain.receivingRecords[1].value}.\n ttl: 3600\n type: MX\n zoneId: ${var.zone_id}\nvariables:\n domain:\n fn::invoke:\n Function: mailgun:getDomain\n Arguments:\n name: test.example.com\n```\n\u003c!--End PulumiCodeChooser --\u003e\n", + "description": "`mailgun.Domain` provides details about a Mailgun domain.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as mailgun from \"@pulumi/mailgun\";\n\nconst domain = mailgun.getDomain({\n name: \"test.example.com\",\n});\nconst mailgun_mx = new aws.index.Route53Record(\"mailgun-mx\", {\n zoneId: zoneId,\n name: domainMailgun.name,\n type: \"MX\",\n ttl: 3600,\n records: [\n `${domain.receivingRecords?.[0]?.priority} ${domain.receivingRecords?.[0]?.value}.`,\n `${domain.receivingRecords?.[1]?.priority} ${domain.receivingRecords?.[1]?.value}.`,\n ],\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_mailgun as mailgun\n\ndomain = mailgun.get_domain(name=\"test.example.com\")\nmailgun_mx = aws.index.Route53Record(\"mailgun-mx\",\n zone_id=zone_id,\n name=domain_mailgun.name,\n type=MX,\n ttl=3600,\n records=[\n f{domain.receiving_records[0].priority} {domain.receiving_records[0].value}.,\n f{domain.receiving_records[1].priority} {domain.receiving_records[1].value}.,\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Mailgun = Pulumi.Mailgun;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var domain = Mailgun.GetDomain.Invoke(new()\n {\n Name = \"test.example.com\",\n });\n\n var mailgun_mx = new Aws.Index.Route53Record(\"mailgun-mx\", new()\n {\n ZoneId = zoneId,\n Name = domainMailgun.Name,\n Type = \"MX\",\n Ttl = 3600,\n Records = new[]\n {\n $\"{domain.Apply(getDomainResult =\u003e getDomainResult.ReceivingRecords[0]?.Priority)} {domain.Apply(getDomainResult =\u003e getDomainResult.ReceivingRecords[0]?.Value)}.\",\n $\"{domain.Apply(getDomainResult =\u003e getDomainResult.ReceivingRecords[1]?.Priority)} {domain.Apply(getDomainResult =\u003e getDomainResult.ReceivingRecords[1]?.Value)}.\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v4/go/aws\"\n\t\"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tdomain, err := mailgun.LookupDomain(ctx, \u0026mailgun.LookupDomainArgs{\n\t\t\tName: \"test.example.com\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = aws.NewRoute53Record(ctx, \"mailgun-mx\", \u0026aws.Route53RecordArgs{\n\t\t\tZoneId: zoneId,\n\t\t\tName: domainMailgun.Name,\n\t\t\tType: \"MX\",\n\t\t\tTtl: 3600,\n\t\t\tRecords: []string{\n\t\t\t\tfmt.Sprintf(\"%v %v.\", domain.ReceivingRecords[0].Priority, domain.ReceivingRecords[0].Value),\n\t\t\t\tfmt.Sprintf(\"%v %v.\", domain.ReceivingRecords[1].Priority, domain.ReceivingRecords[1].Value),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mailgun.MailgunFunctions;\nimport com.pulumi.mailgun.inputs.GetDomainArgs;\nimport com.pulumi.aws.route53Record;\nimport com.pulumi.aws.Route53RecordArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var domain = MailgunFunctions.getDomain(GetDomainArgs.builder()\n .name(\"test.example.com\")\n .build());\n\n var mailgun_mx = new Route53Record(\"mailgun-mx\", Route53RecordArgs.builder() \n .zoneId(zoneId)\n .name(domainMailgun.name())\n .type(\"MX\")\n .ttl(3600)\n .records( \n String.format(\"%s %s.\", domain.applyValue(getDomainResult -\u003e getDomainResult.receivingRecords()[0].priority()),domain.applyValue(getDomainResult -\u003e getDomainResult.receivingRecords()[0].value())),\n String.format(\"%s %s.\", domain.applyValue(getDomainResult -\u003e getDomainResult.receivingRecords()[1].priority()),domain.applyValue(getDomainResult -\u003e getDomainResult.receivingRecords()[1].value())))\n .build());\n\n }\n}\n```\n```yaml\nresources:\n mailgun-mx:\n type: aws:route53Record\n properties:\n zoneId: ${zoneId}\n name: ${domainMailgun.name}\n type: MX\n ttl: 3600\n records:\n - ${domain.receivingRecords[0].priority} ${domain.receivingRecords[0].value}.\n - ${domain.receivingRecords[1].priority} ${domain.receivingRecords[1].value}.\nvariables:\n domain:\n fn::invoke:\n Function: mailgun:getDomain\n Arguments:\n name: test.example.com\n```\n\u003c!--End PulumiCodeChooser --\u003e\n", "inputs": { "description": "A collection of arguments for invoking getDomain.\n", "properties": { @@ -901,66 +901,65 @@ "type": "boolean" }, "id": { - "type": "string", - "description": "The provider-assigned unique ID for this managed resource.\n" + "description": "The provider-assigned unique ID for this managed resource.\n", + "type": "string" }, "name": { - "type": "string", - "description": "The name of the record.\n" + "description": "The name of the record.\n", + "type": "string" }, "openTracking": { "type": "boolean" }, "receivingRecords": { - "type": "array", + "deprecationMessage": "Use `receiving_records_set` instead.", + "description": "A list of DNS records for receiving validation.\n", "items": { "$ref": "#/types/mailgun:index/getDomainReceivingRecord:getDomainReceivingRecord" }, - "description": "A list of DNS records for receiving validation.\n", - "deprecationMessage": "Use `receiving_records_set` instead." + "type": "array" }, "receivingRecordsSets": { - "type": "array", "items": { "$ref": "#/types/mailgun:index/getDomainReceivingRecordsSet:getDomainReceivingRecordsSet" - } + }, + "type": "array" }, "region": { "type": "string" }, "sendingRecords": { - "type": "array", + "deprecationMessage": "Use `sending_records_set` instead.", + "description": "A list of DNS records for sending validation.\n", "items": { "$ref": "#/types/mailgun:index/getDomainSendingRecord:getDomainSendingRecord" }, - "description": "A list of DNS records for sending validation.\n", - "deprecationMessage": "Use `sending_records_set` instead." + "type": "array" }, "sendingRecordsSets": { - "type": "array", "items": { "$ref": "#/types/mailgun:index/getDomainSendingRecordsSet:getDomainSendingRecordsSet" - } + }, + "type": "array" }, "smtpLogin": { - "type": "string", - "description": "The login email for the SMTP server.\n" + "description": "The login email for the SMTP server.\n", + "type": "string" }, "smtpPassword": { - "type": "string", "description": "The password to the SMTP server.\n", - "secret": true + "secret": true, + "type": "string" }, "spamAction": { - "type": "string", - "description": "The spam filtering setting.\n" + "description": "The spam filtering setting.\n", + "type": "string" }, "wildcard": { - "type": "boolean", - "description": "Whether or not the domain will accept email for sub-domains.\n" + "description": "Whether or not the domain will accept email for sub-domains.\n", + "type": "boolean" } }, - "type": "object", "required": [ "name", "receivingRecords", @@ -969,7 +968,8 @@ "sendingRecordsSets", "smtpLogin", "id" - ] + ], + "type": "object" } } } diff --git a/sdk/dotnet/Domain.cs b/sdk/dotnet/Domain.cs index 759bec3b..36d21052 100644 --- a/sdk/dotnet/Domain.cs +++ b/sdk/dotnet/Domain.cs @@ -29,10 +29,11 @@ namespace Pulumi.Mailgun /// // Create a new Mailgun domain /// var @default = new Mailgun.Domain("default", new() /// { - /// DkimKeySize = 1024, + /// Name = "test.example.com", /// Region = "us", - /// SmtpPassword = "supersecretpassword1234", /// SpamAction = "disabled", + /// SmtpPassword = "supersecretpassword1234", + /// DkimKeySize = 1024, /// }); /// /// }); diff --git a/sdk/dotnet/DomainCredential.cs b/sdk/dotnet/DomainCredential.cs index 8c69b5f5..234f9d48 100644 --- a/sdk/dotnet/DomainCredential.cs +++ b/sdk/dotnet/DomainCredential.cs @@ -14,6 +14,30 @@ namespace Pulumi.Mailgun /// /// > **Note:** Please note that starting of v0.6.1 due to using new Mailgun Client API (v4), there is no possibility to retrieve previously created secrets via API. In order get it worked, it's recommended to mark `password` as ignored under `lifecycle` block. See below. /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Mailgun = Pulumi.Mailgun; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Create a new Mailgun credential + /// var foobar = new Mailgun.DomainCredential("foobar", new() + /// { + /// Domain = "toto.com", + /// Login = "test", + /// Password = "supersecretpassword1234", + /// Region = "us", + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// /// ## Import /// /// Domain credential can be imported using `region:email` via `import` command. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). diff --git a/sdk/dotnet/GetDomain.cs b/sdk/dotnet/GetDomain.cs index 03be861f..765d97fc 100644 --- a/sdk/dotnet/GetDomain.cs +++ b/sdk/dotnet/GetDomain.cs @@ -31,27 +31,17 @@ public static class GetDomain /// Name = "test.example.com", /// }); /// - /// var mailgun_mx = new Aws.Route53.Record("mailgun-mx", new() + /// var mailgun_mx = new Aws.Index.Route53Record("mailgun-mx", new() /// { - /// Name = data.Mailgun.Domain.Name, + /// ZoneId = zoneId, + /// Name = domainMailgun.Name, + /// Type = "MX", + /// Ttl = 3600, /// Records = new[] /// { - /// Output.Tuple(domain, domain).Apply(values => - /// { - /// var domain = values.Item1; - /// var domain1 = values.Item2; - /// return $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[0]?.Priority)} {domain1.ReceivingRecords[0]?.Value}."; - /// }), - /// Output.Tuple(domain, domain).Apply(values => - /// { - /// var domain = values.Item1; - /// var domain1 = values.Item2; - /// return $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[1]?.Priority)} {domain1.ReceivingRecords[1]?.Value}."; - /// }), + /// $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[0]?.Priority)} {domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[0]?.Value)}.", + /// $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[1]?.Priority)} {domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[1]?.Value)}.", /// }, - /// Ttl = 3600, - /// Type = Aws.Route53.RecordType.MX, - /// ZoneId = @var.Zone_id, /// }); /// /// }); @@ -81,27 +71,17 @@ public static Task InvokeAsync(GetDomainArgs args, InvokeOption /// Name = "test.example.com", /// }); /// - /// var mailgun_mx = new Aws.Route53.Record("mailgun-mx", new() + /// var mailgun_mx = new Aws.Index.Route53Record("mailgun-mx", new() /// { - /// Name = data.Mailgun.Domain.Name, + /// ZoneId = zoneId, + /// Name = domainMailgun.Name, + /// Type = "MX", + /// Ttl = 3600, /// Records = new[] /// { - /// Output.Tuple(domain, domain).Apply(values => - /// { - /// var domain = values.Item1; - /// var domain1 = values.Item2; - /// return $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[0]?.Priority)} {domain1.ReceivingRecords[0]?.Value}."; - /// }), - /// Output.Tuple(domain, domain).Apply(values => - /// { - /// var domain = values.Item1; - /// var domain1 = values.Item2; - /// return $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[1]?.Priority)} {domain1.ReceivingRecords[1]?.Value}."; - /// }), + /// $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[0]?.Priority)} {domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[0]?.Value)}.", + /// $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[1]?.Priority)} {domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[1]?.Value)}.", /// }, - /// Ttl = 3600, - /// Type = Aws.Route53.RecordType.MX, - /// ZoneId = @var.Zone_id, /// }); /// /// }); diff --git a/sdk/dotnet/Route.cs b/sdk/dotnet/Route.cs index de5f96fe..43504c4d 100644 --- a/sdk/dotnet/Route.cs +++ b/sdk/dotnet/Route.cs @@ -26,14 +26,14 @@ namespace Pulumi.Mailgun /// // Create a new Mailgun route /// var @default = new Mailgun.Route("default", new() /// { + /// Priority = 0, + /// Description = "inbound", + /// Expression = "match_recipient('.*@foo.example.com')", /// Actions = new[] /// { /// "forward('http://example.com/api/v1/foos/')", /// "stop()", /// }, - /// Description = "inbound", - /// Expression = "match_recipient('.*@foo.example.com')", - /// Priority = 0, /// }); /// /// }); diff --git a/sdk/dotnet/Webhook.cs b/sdk/dotnet/Webhook.cs index 76325507..251c4e7b 100644 --- a/sdk/dotnet/Webhook.cs +++ b/sdk/dotnet/Webhook.cs @@ -28,8 +28,8 @@ namespace Pulumi.Mailgun /// var @default = new Mailgun.Webhook("default", new() /// { /// Domain = "test.example.com", - /// Kind = "delivered", /// Region = "us", + /// Kind = "delivered", /// Urls = new[] /// { /// "https://example.com", diff --git a/sdk/go/mailgun/domain.go b/sdk/go/mailgun/domain.go index 99b3d90b..c01ebc07 100644 --- a/sdk/go/mailgun/domain.go +++ b/sdk/go/mailgun/domain.go @@ -33,10 +33,11 @@ import ( // pulumi.Run(func(ctx *pulumi.Context) error { // // Create a new Mailgun domain // _, err := mailgun.NewDomain(ctx, "default", &mailgun.DomainArgs{ -// DkimKeySize: pulumi.Int(1024), +// Name: pulumi.String("test.example.com"), // Region: pulumi.String("us"), -// SmtpPassword: pulumi.String("supersecretpassword1234"), // SpamAction: pulumi.String("disabled"), +// SmtpPassword: pulumi.String("supersecretpassword1234"), +// DkimKeySize: pulumi.Int(1024), // }) // if err != nil { // return err diff --git a/sdk/go/mailgun/domainCredential.go b/sdk/go/mailgun/domainCredential.go index d83155c1..e9f4c257 100644 --- a/sdk/go/mailgun/domainCredential.go +++ b/sdk/go/mailgun/domainCredential.go @@ -16,6 +16,38 @@ import ( // // > **Note:** Please note that starting of v0.6.1 due to using new Mailgun Client API (v4), there is no possibility to retrieve previously created secrets via API. In order get it worked, it's recommended to mark `password` as ignored under `lifecycle` block. See below. // +// ## Example Usage +// +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// // Create a new Mailgun credential +// _, err := mailgun.NewDomainCredential(ctx, "foobar", &mailgun.DomainCredentialArgs{ +// Domain: pulumi.String("toto.com"), +// Login: pulumi.String("test"), +// Password: pulumi.String("supersecretpassword1234"), +// Region: pulumi.String("us"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// // ## Import // // Domain credential can be imported using `region:email` via `import` command. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). diff --git a/sdk/go/mailgun/getDomain.go b/sdk/go/mailgun/getDomain.go index be197b17..c59fa7d7 100644 --- a/sdk/go/mailgun/getDomain.go +++ b/sdk/go/mailgun/getDomain.go @@ -23,7 +23,7 @@ import ( // // "fmt" // -// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53" +// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws" // "github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun" // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" // @@ -37,15 +37,15 @@ import ( // if err != nil { // return err // } -// _, err = route53.NewRecord(ctx, "mailgun-mx", &route53.RecordArgs{ -// Name: pulumi.Any(data.Mailgun.Domain.Name), -// Records: pulumi.StringArray{ -// pulumi.String(fmt.Sprintf("%v %v.", domain.ReceivingRecords[0].Priority, domain.ReceivingRecords[0].Value)), -// pulumi.String(fmt.Sprintf("%v %v.", domain.ReceivingRecords[1].Priority, domain.ReceivingRecords[1].Value)), +// _, err = aws.NewRoute53Record(ctx, "mailgun-mx", &aws.Route53RecordArgs{ +// ZoneId: zoneId, +// Name: domainMailgun.Name, +// Type: "MX", +// Ttl: 3600, +// Records: []string{ +// fmt.Sprintf("%v %v.", domain.ReceivingRecords[0].Priority, domain.ReceivingRecords[0].Value), +// fmt.Sprintf("%v %v.", domain.ReceivingRecords[1].Priority, domain.ReceivingRecords[1].Value), // }, -// Ttl: pulumi.Int(3600), -// Type: pulumi.String(route53.RecordTypeMX), -// ZoneId: pulumi.Any(_var.Zone_id), // }) // if err != nil { // return err diff --git a/sdk/go/mailgun/route.go b/sdk/go/mailgun/route.go index 552a7677..127a3863 100644 --- a/sdk/go/mailgun/route.go +++ b/sdk/go/mailgun/route.go @@ -31,13 +31,13 @@ import ( // pulumi.Run(func(ctx *pulumi.Context) error { // // Create a new Mailgun route // _, err := mailgun.NewRoute(ctx, "default", &mailgun.RouteArgs{ +// Priority: pulumi.Int(0), +// Description: pulumi.String("inbound"), +// Expression: pulumi.String("match_recipient('.*@foo.example.com')"), // Actions: pulumi.StringArray{ // pulumi.String("forward('http://example.com/api/v1/foos/')"), // pulumi.String("stop()"), // }, -// Description: pulumi.String("inbound"), -// Expression: pulumi.String("match_recipient('.*@foo.example.com')"), -// Priority: pulumi.Int(0), // }) // if err != nil { // return err diff --git a/sdk/go/mailgun/webhook.go b/sdk/go/mailgun/webhook.go index a4bacaf5..fcbe11b2 100644 --- a/sdk/go/mailgun/webhook.go +++ b/sdk/go/mailgun/webhook.go @@ -33,8 +33,8 @@ import ( // // Create a new Mailgun webhook // _, err := mailgun.NewWebhook(ctx, "default", &mailgun.WebhookArgs{ // Domain: pulumi.String("test.example.com"), -// Kind: pulumi.String("delivered"), // Region: pulumi.String("us"), +// Kind: pulumi.String("delivered"), // Urls: pulumi.StringArray{ // pulumi.String("https://example.com"), // }, diff --git a/sdk/java/src/main/java/com/pulumi/mailgun/Domain.java b/sdk/java/src/main/java/com/pulumi/mailgun/Domain.java index e8c826ea..64a4dd3b 100644 --- a/sdk/java/src/main/java/com/pulumi/mailgun/Domain.java +++ b/sdk/java/src/main/java/com/pulumi/mailgun/Domain.java @@ -53,10 +53,11 @@ * public static void stack(Context ctx) { * // Create a new Mailgun domain * var default_ = new Domain("default", DomainArgs.builder() - * .dkimKeySize(1024) + * .name("test.example.com") * .region("us") - * .smtpPassword("supersecretpassword1234") * .spamAction("disabled") + * .smtpPassword("supersecretpassword1234") + * .dkimKeySize(1024) * .build()); * * } diff --git a/sdk/java/src/main/java/com/pulumi/mailgun/DomainCredential.java b/sdk/java/src/main/java/com/pulumi/mailgun/DomainCredential.java index c2538357..a883e75e 100644 --- a/sdk/java/src/main/java/com/pulumi/mailgun/DomainCredential.java +++ b/sdk/java/src/main/java/com/pulumi/mailgun/DomainCredential.java @@ -47,7 +47,6 @@ * // Create a new Mailgun credential * var foobar = new DomainCredential("foobar", DomainCredentialArgs.builder() * .domain("toto.com") - * .lifecycle(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference)) * .login("test") * .password("supersecretpassword1234") * .region("us") diff --git a/sdk/java/src/main/java/com/pulumi/mailgun/MailgunFunctions.java b/sdk/java/src/main/java/com/pulumi/mailgun/MailgunFunctions.java index 4e9517a8..380a1928 100644 --- a/sdk/java/src/main/java/com/pulumi/mailgun/MailgunFunctions.java +++ b/sdk/java/src/main/java/com/pulumi/mailgun/MailgunFunctions.java @@ -28,8 +28,8 @@ public final class MailgunFunctions { * import com.pulumi.core.Output; * import com.pulumi.mailgun.MailgunFunctions; * import com.pulumi.mailgun.inputs.GetDomainArgs; - * import com.pulumi.aws.route53.Record; - * import com.pulumi.aws.route53.RecordArgs; + * import com.pulumi.aws.route53Record; + * import com.pulumi.aws.Route53RecordArgs; * import java.util.List; * import java.util.ArrayList; * import java.util.Map; @@ -47,14 +47,14 @@ public final class MailgunFunctions { * .name("test.example.com") * .build()); * - * var mailgun_mx = new Record("mailgun-mx", RecordArgs.builder() - * .name(data.mailgun().domain().name()) + * var mailgun_mx = new Route53Record("mailgun-mx", Route53RecordArgs.builder() + * .zoneId(zoneId) + * .name(domainMailgun.name()) + * .type("MX") + * .ttl(3600) * .records( * String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].value())), * String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].value()))) - * .ttl(3600) - * .type("MX") - * .zoneId(var_.zone_id()) * .build()); * * } @@ -80,8 +80,8 @@ public static Output getDomain(GetDomainArgs args) { * import com.pulumi.core.Output; * import com.pulumi.mailgun.MailgunFunctions; * import com.pulumi.mailgun.inputs.GetDomainArgs; - * import com.pulumi.aws.route53.Record; - * import com.pulumi.aws.route53.RecordArgs; + * import com.pulumi.aws.route53Record; + * import com.pulumi.aws.Route53RecordArgs; * import java.util.List; * import java.util.ArrayList; * import java.util.Map; @@ -99,14 +99,14 @@ public static Output getDomain(GetDomainArgs args) { * .name("test.example.com") * .build()); * - * var mailgun_mx = new Record("mailgun-mx", RecordArgs.builder() - * .name(data.mailgun().domain().name()) + * var mailgun_mx = new Route53Record("mailgun-mx", Route53RecordArgs.builder() + * .zoneId(zoneId) + * .name(domainMailgun.name()) + * .type("MX") + * .ttl(3600) * .records( * String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].value())), * String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].value()))) - * .ttl(3600) - * .type("MX") - * .zoneId(var_.zone_id()) * .build()); * * } @@ -132,8 +132,8 @@ public static CompletableFuture getDomainPlain(GetDomainPlainAr * import com.pulumi.core.Output; * import com.pulumi.mailgun.MailgunFunctions; * import com.pulumi.mailgun.inputs.GetDomainArgs; - * import com.pulumi.aws.route53.Record; - * import com.pulumi.aws.route53.RecordArgs; + * import com.pulumi.aws.route53Record; + * import com.pulumi.aws.Route53RecordArgs; * import java.util.List; * import java.util.ArrayList; * import java.util.Map; @@ -151,14 +151,14 @@ public static CompletableFuture getDomainPlain(GetDomainPlainAr * .name("test.example.com") * .build()); * - * var mailgun_mx = new Record("mailgun-mx", RecordArgs.builder() - * .name(data.mailgun().domain().name()) + * var mailgun_mx = new Route53Record("mailgun-mx", Route53RecordArgs.builder() + * .zoneId(zoneId) + * .name(domainMailgun.name()) + * .type("MX") + * .ttl(3600) * .records( * String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].value())), * String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].value()))) - * .ttl(3600) - * .type("MX") - * .zoneId(var_.zone_id()) * .build()); * * } @@ -184,8 +184,8 @@ public static Output getDomain(GetDomainArgs args, InvokeOption * import com.pulumi.core.Output; * import com.pulumi.mailgun.MailgunFunctions; * import com.pulumi.mailgun.inputs.GetDomainArgs; - * import com.pulumi.aws.route53.Record; - * import com.pulumi.aws.route53.RecordArgs; + * import com.pulumi.aws.route53Record; + * import com.pulumi.aws.Route53RecordArgs; * import java.util.List; * import java.util.ArrayList; * import java.util.Map; @@ -203,14 +203,14 @@ public static Output getDomain(GetDomainArgs args, InvokeOption * .name("test.example.com") * .build()); * - * var mailgun_mx = new Record("mailgun-mx", RecordArgs.builder() - * .name(data.mailgun().domain().name()) + * var mailgun_mx = new Route53Record("mailgun-mx", Route53RecordArgs.builder() + * .zoneId(zoneId) + * .name(domainMailgun.name()) + * .type("MX") + * .ttl(3600) * .records( * String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].value())), * String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].value()))) - * .ttl(3600) - * .type("MX") - * .zoneId(var_.zone_id()) * .build()); * * } diff --git a/sdk/java/src/main/java/com/pulumi/mailgun/Route.java b/sdk/java/src/main/java/com/pulumi/mailgun/Route.java index 1aed1a5d..463b93d5 100644 --- a/sdk/java/src/main/java/com/pulumi/mailgun/Route.java +++ b/sdk/java/src/main/java/com/pulumi/mailgun/Route.java @@ -45,12 +45,12 @@ * public static void stack(Context ctx) { * // Create a new Mailgun route * var default_ = new Route("default", RouteArgs.builder() + * .priority("0") + * .description("inbound") + * .expression("match_recipient('.*@foo.example.com')") * .actions( * "forward('http://example.com/api/v1/foos/')", * "stop()") - * .description("inbound") - * .expression("match_recipient('.*@foo.example.com')") - * .priority("0") * .build()); * * } diff --git a/sdk/java/src/main/java/com/pulumi/mailgun/Webhook.java b/sdk/java/src/main/java/com/pulumi/mailgun/Webhook.java index f440221d..69d7d888 100644 --- a/sdk/java/src/main/java/com/pulumi/mailgun/Webhook.java +++ b/sdk/java/src/main/java/com/pulumi/mailgun/Webhook.java @@ -46,8 +46,8 @@ * // Create a new Mailgun webhook * var default_ = new Webhook("default", WebhookArgs.builder() * .domain("test.example.com") - * .kind("delivered") * .region("us") + * .kind("delivered") * .urls("https://example.com") * .build()); * diff --git a/sdk/nodejs/domain.ts b/sdk/nodejs/domain.ts index eb2bfc1c..343698cc 100644 --- a/sdk/nodejs/domain.ts +++ b/sdk/nodejs/domain.ts @@ -21,10 +21,11 @@ import * as utilities from "./utilities"; * * // Create a new Mailgun domain * const _default = new mailgun.Domain("default", { - * dkimKeySize: 1024, + * name: "test.example.com", * region: "us", - * smtpPassword: "supersecretpassword1234", * spamAction: "disabled", + * smtpPassword: "supersecretpassword1234", + * dkimKeySize: 1024, * }); * ``` * diff --git a/sdk/nodejs/domainCredential.ts b/sdk/nodejs/domainCredential.ts index 283dd75a..2b5b19d0 100644 --- a/sdk/nodejs/domainCredential.ts +++ b/sdk/nodejs/domainCredential.ts @@ -9,6 +9,23 @@ import * as utilities from "./utilities"; * * > **Note:** Please note that starting of v0.6.1 due to using new Mailgun Client API (v4), there is no possibility to retrieve previously created secrets via API. In order get it worked, it's recommended to mark `password` as ignored under `lifecycle` block. See below. * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as mailgun from "@pulumi/mailgun"; + * + * // Create a new Mailgun credential + * const foobar = new mailgun.DomainCredential("foobar", { + * domain: "toto.com", + * login: "test", + * password: "supersecretpassword1234", + * region: "us", + * }); + * ``` + * + * * ## Import * * Domain credential can be imported using `region:email` via `import` command. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). diff --git a/sdk/nodejs/getDomain.ts b/sdk/nodejs/getDomain.ts index 1d5b9ee6..a16f933c 100644 --- a/sdk/nodejs/getDomain.ts +++ b/sdk/nodejs/getDomain.ts @@ -20,15 +20,15 @@ import * as utilities from "./utilities"; * const domain = mailgun.getDomain({ * name: "test.example.com", * }); - * const mailgun_mx = new aws.route53.Record("mailgun-mx", { - * name: data.mailgun.domain.name, + * const mailgun_mx = new aws.index.Route53Record("mailgun-mx", { + * zoneId: zoneId, + * name: domainMailgun.name, + * type: "MX", + * ttl: 3600, * records: [ - * Promise.all([domain, domain]).then(([domain, domain1]) => `${domain.receivingRecords?.[0]?.priority} ${domain1.receivingRecords?.[0]?.value}.`), - * Promise.all([domain, domain]).then(([domain, domain1]) => `${domain.receivingRecords?.[1]?.priority} ${domain1.receivingRecords?.[1]?.value}.`), + * `${domain.receivingRecords?.[0]?.priority} ${domain.receivingRecords?.[0]?.value}.`, + * `${domain.receivingRecords?.[1]?.priority} ${domain.receivingRecords?.[1]?.value}.`, * ], - * ttl: 3600, - * type: aws.route53.RecordType.MX, - * zoneId: _var.zone_id, * }); * ``` * @@ -141,15 +141,15 @@ export interface GetDomainResult { * const domain = mailgun.getDomain({ * name: "test.example.com", * }); - * const mailgun_mx = new aws.route53.Record("mailgun-mx", { - * name: data.mailgun.domain.name, + * const mailgun_mx = new aws.index.Route53Record("mailgun-mx", { + * zoneId: zoneId, + * name: domainMailgun.name, + * type: "MX", + * ttl: 3600, * records: [ - * Promise.all([domain, domain]).then(([domain, domain1]) => `${domain.receivingRecords?.[0]?.priority} ${domain1.receivingRecords?.[0]?.value}.`), - * Promise.all([domain, domain]).then(([domain, domain1]) => `${domain.receivingRecords?.[1]?.priority} ${domain1.receivingRecords?.[1]?.value}.`), + * `${domain.receivingRecords?.[0]?.priority} ${domain.receivingRecords?.[0]?.value}.`, + * `${domain.receivingRecords?.[1]?.priority} ${domain.receivingRecords?.[1]?.value}.`, * ], - * ttl: 3600, - * type: aws.route53.RecordType.MX, - * zoneId: _var.zone_id, * }); * ``` * diff --git a/sdk/nodejs/route.ts b/sdk/nodejs/route.ts index 37f4de1e..3f1e7305 100644 --- a/sdk/nodejs/route.ts +++ b/sdk/nodejs/route.ts @@ -16,13 +16,13 @@ import * as utilities from "./utilities"; * * // Create a new Mailgun route * const _default = new mailgun.Route("default", { + * priority: 0, + * description: "inbound", + * expression: "match_recipient('.*@foo.example.com')", * actions: [ * "forward('http://example.com/api/v1/foos/')", * "stop()", * ], - * description: "inbound", - * expression: "match_recipient('.*@foo.example.com')", - * priority: 0, * }); * ``` * diff --git a/sdk/nodejs/webhook.ts b/sdk/nodejs/webhook.ts index 17133309..0e7d31c5 100644 --- a/sdk/nodejs/webhook.ts +++ b/sdk/nodejs/webhook.ts @@ -18,8 +18,8 @@ import * as utilities from "./utilities"; * // Create a new Mailgun webhook * const _default = new mailgun.Webhook("default", { * domain: "test.example.com", - * kind: "delivered", * region: "us", + * kind: "delivered", * urls: ["https://example.com"], * }); * ``` diff --git a/sdk/python/pulumi_mailgun/domain.py b/sdk/python/pulumi_mailgun/domain.py index 42c698cc..d9aabea7 100644 --- a/sdk/python/pulumi_mailgun/domain.py +++ b/sdk/python/pulumi_mailgun/domain.py @@ -451,10 +451,11 @@ def __init__(__self__, # Create a new Mailgun domain default = mailgun.Domain("default", - dkim_key_size=1024, + name="test.example.com", region="us", + spam_action="disabled", smtp_password="supersecretpassword1234", - spam_action="disabled") + dkim_key_size=1024) ``` @@ -504,10 +505,11 @@ def __init__(__self__, # Create a new Mailgun domain default = mailgun.Domain("default", - dkim_key_size=1024, + name="test.example.com", region="us", + spam_action="disabled", smtp_password="supersecretpassword1234", - spam_action="disabled") + dkim_key_size=1024) ``` diff --git a/sdk/python/pulumi_mailgun/domain_credential.py b/sdk/python/pulumi_mailgun/domain_credential.py index b6f96f39..64204974 100644 --- a/sdk/python/pulumi_mailgun/domain_credential.py +++ b/sdk/python/pulumi_mailgun/domain_credential.py @@ -167,6 +167,22 @@ def __init__(__self__, > **Note:** Please note that starting of v0.6.1 due to using new Mailgun Client API (v4), there is no possibility to retrieve previously created secrets via API. In order get it worked, it's recommended to mark `password` as ignored under `lifecycle` block. See below. + ## Example Usage + + + ```python + import pulumi + import pulumi_mailgun as mailgun + + # Create a new Mailgun credential + foobar = mailgun.DomainCredential("foobar", + domain="toto.com", + login="test", + password="supersecretpassword1234", + region="us") + ``` + + ## Import Domain credential can be imported using `region:email` via `import` command. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). @@ -197,6 +213,22 @@ def __init__(__self__, > **Note:** Please note that starting of v0.6.1 due to using new Mailgun Client API (v4), there is no possibility to retrieve previously created secrets via API. In order get it worked, it's recommended to mark `password` as ignored under `lifecycle` block. See below. + ## Example Usage + + + ```python + import pulumi + import pulumi_mailgun as mailgun + + # Create a new Mailgun credential + foobar = mailgun.DomainCredential("foobar", + domain="toto.com", + login="test", + password="supersecretpassword1234", + region="us") + ``` + + ## Import Domain credential can be imported using `region:email` via `import` command. Region has to be chosen from `eu` or `us` (when no selection `us` is applied). diff --git a/sdk/python/pulumi_mailgun/get_domain.py b/sdk/python/pulumi_mailgun/get_domain.py index 7e849c93..7b178d9a 100644 --- a/sdk/python/pulumi_mailgun/get_domain.py +++ b/sdk/python/pulumi_mailgun/get_domain.py @@ -220,15 +220,15 @@ def get_domain(dkim_key_size: Optional[int] = None, import pulumi_mailgun as mailgun domain = mailgun.get_domain(name="test.example.com") - mailgun_mx = aws.route53.Record("mailgun-mx", - name=data["mailgun"]["domain"]["name"], - records=[ - f"{domain.receiving_records[0].priority} {domain.receiving_records[0].value}.", - f"{domain.receiving_records[1].priority} {domain.receiving_records[1].value}.", - ], + mailgun_mx = aws.index.Route53Record("mailgun-mx", + zone_id=zone_id, + name=domain_mailgun.name, + type=MX, ttl=3600, - type=aws.route53.RecordType.MX, - zone_id=var["zone_id"]) + records=[ + f{domain.receiving_records[0].priority} {domain.receiving_records[0].value}., + f{domain.receiving_records[1].priority} {domain.receiving_records[1].value}., + ]) ``` @@ -293,15 +293,15 @@ def get_domain_output(dkim_key_size: Optional[pulumi.Input[Optional[int]]] = Non import pulumi_mailgun as mailgun domain = mailgun.get_domain(name="test.example.com") - mailgun_mx = aws.route53.Record("mailgun-mx", - name=data["mailgun"]["domain"]["name"], - records=[ - f"{domain.receiving_records[0].priority} {domain.receiving_records[0].value}.", - f"{domain.receiving_records[1].priority} {domain.receiving_records[1].value}.", - ], + mailgun_mx = aws.index.Route53Record("mailgun-mx", + zone_id=zone_id, + name=domain_mailgun.name, + type=MX, ttl=3600, - type=aws.route53.RecordType.MX, - zone_id=var["zone_id"]) + records=[ + f{domain.receiving_records[0].priority} {domain.receiving_records[0].value}., + f{domain.receiving_records[1].priority} {domain.receiving_records[1].value}., + ]) ``` diff --git a/sdk/python/pulumi_mailgun/route.py b/sdk/python/pulumi_mailgun/route.py index f94ca1d4..bddc0d5c 100644 --- a/sdk/python/pulumi_mailgun/route.py +++ b/sdk/python/pulumi_mailgun/route.py @@ -191,13 +191,13 @@ def __init__(__self__, # Create a new Mailgun route default = mailgun.Route("default", + priority=0, + description="inbound", + expression="match_recipient('.*@foo.example.com')", actions=[ "forward('http://example.com/api/v1/foos/')", "stop()", - ], - description="inbound", - expression="match_recipient('.*@foo.example.com')", - priority=0) + ]) ``` @@ -235,13 +235,13 @@ def __init__(__self__, # Create a new Mailgun route default = mailgun.Route("default", + priority=0, + description="inbound", + expression="match_recipient('.*@foo.example.com')", actions=[ "forward('http://example.com/api/v1/foos/')", "stop()", - ], - description="inbound", - expression="match_recipient('.*@foo.example.com')", - priority=0) + ]) ``` diff --git a/sdk/python/pulumi_mailgun/webhook.py b/sdk/python/pulumi_mailgun/webhook.py index 091628fb..83d18a09 100644 --- a/sdk/python/pulumi_mailgun/webhook.py +++ b/sdk/python/pulumi_mailgun/webhook.py @@ -176,8 +176,8 @@ def __init__(__self__, # Create a new Mailgun webhook default = mailgun.Webhook("default", domain="test.example.com", - kind="delivered", region="us", + kind="delivered", urls=["https://example.com"]) ``` @@ -209,8 +209,8 @@ def __init__(__self__, # Create a new Mailgun webhook default = mailgun.Webhook("default", domain="test.example.com", - kind="delivered", region="us", + kind="delivered", urls=["https://example.com"]) ```