pulumi-namecheap 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +267 -3
- package/bin/package.json +23 -6
- package/bin/package.mjs +23 -6
- package/package.json +19 -6
package/README.md
CHANGED
|
@@ -1,3 +1,267 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Pulumi Namecheap Provider
|
|
2
|
+
|
|
3
|
+
A Pulumi provider for managing Namecheap resources, dynamically bridged from the [Terraform Namecheap Provider](https://github.com/namecheap/terraform-provider-namecheap).
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
This package provides a Pulumi provider that enables you to manage your Namecheap domain records and DNS configuration using TypeScript, JavaScript, Python, Go, or C#. The provider is automatically generated from the Terraform Namecheap provider, giving you access to all its functionality within the Pulumi ecosystem.
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **Domain Record Management**: Create and manage DNS records (A, AAAA, CNAME, MX, TXT, etc.) for your Namecheap domains
|
|
12
|
+
- **Multiple Record Types**: Support for A, AAAA, ALIAS, CAA, CNAME, MX, MXE, NS, TXT, URL, URL301, and FRAME records
|
|
13
|
+
- **Email Configuration**: Configure email services with support for NONE, MXE, MX, FWD, OX, and GMAIL
|
|
14
|
+
- **Sandbox Support**: Test your configurations in Namecheap's sandbox environment
|
|
15
|
+
- **TypeScript Support**: Full type safety with comprehensive TypeScript definitions
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
### npm
|
|
20
|
+
```bash
|
|
21
|
+
npm install pulumi-namecheap
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### yarn
|
|
25
|
+
```bash
|
|
26
|
+
yarn add pulumi-namecheap
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### pnpm
|
|
30
|
+
```bash
|
|
31
|
+
pnpm add pulumi-namecheap
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Configuration
|
|
35
|
+
|
|
36
|
+
Before using the provider, you need to configure authentication with your Namecheap API credentials.
|
|
37
|
+
|
|
38
|
+
### Required Configuration
|
|
39
|
+
|
|
40
|
+
- **API Key**: Your Namecheap API key
|
|
41
|
+
- **API User**: Your Namecheap API username
|
|
42
|
+
- **Username**: Your Namecheap account username
|
|
43
|
+
- **Client IP**: The IP address from which you're making API calls (must be whitelisted in Namecheap)
|
|
44
|
+
|
|
45
|
+
### Optional Configuration
|
|
46
|
+
|
|
47
|
+
- **Use Sandbox**: Set to `true` to use Namecheap's sandbox environment for testing
|
|
48
|
+
|
|
49
|
+
### Setting Configuration
|
|
50
|
+
|
|
51
|
+
You can configure the provider in several ways:
|
|
52
|
+
|
|
53
|
+
#### 1. Using Pulumi Config
|
|
54
|
+
```bash
|
|
55
|
+
pulumi config set namecheap:apiKey your-api-key
|
|
56
|
+
pulumi config set namecheap:apiUser your-api-user
|
|
57
|
+
pulumi config set namecheap:userName your-username
|
|
58
|
+
pulumi config set namecheap:clientIp your-client-ip
|
|
59
|
+
pulumi config set namecheap:useSandbox false # optional
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### 2. Using Environment Variables
|
|
63
|
+
```bash
|
|
64
|
+
export NAMECHEAP_API_KEY="your-api-key"
|
|
65
|
+
export NAMECHEAP_API_USER="your-api-user"
|
|
66
|
+
export NAMECHEAP_USER_NAME="your-username"
|
|
67
|
+
export NAMECHEAP_CLIENT_IP="your-client-ip"
|
|
68
|
+
export NAMECHEAP_USE_SANDBOX="false" # optional
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### 3. Provider Constructor
|
|
72
|
+
```typescript
|
|
73
|
+
import * as namecheap from "pulumi-namecheap";
|
|
74
|
+
|
|
75
|
+
const provider = new namecheap.Provider("namecheap-provider", {
|
|
76
|
+
apiKey: "your-api-key",
|
|
77
|
+
apiUser: "your-api-user",
|
|
78
|
+
userName: "your-username",
|
|
79
|
+
clientIp: "your-client-ip",
|
|
80
|
+
useSandbox: false, // optional
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Usage
|
|
85
|
+
|
|
86
|
+
### Basic Domain Records Management
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import * as namecheap from "pulumi-namecheap";
|
|
90
|
+
|
|
91
|
+
// Create DNS records for your domain
|
|
92
|
+
const records = new namecheap.DomainRecords("my-domain-records", {
|
|
93
|
+
domain: "example.com",
|
|
94
|
+
mode: "OVERWRITE", // MERGE (default) or OVERWRITE
|
|
95
|
+
records: [
|
|
96
|
+
{
|
|
97
|
+
hostname: "@",
|
|
98
|
+
type: "A",
|
|
99
|
+
address: "192.168.1.100",
|
|
100
|
+
ttl: 300,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
hostname: "www",
|
|
104
|
+
type: "CNAME",
|
|
105
|
+
address: "example.com",
|
|
106
|
+
ttl: 300,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
hostname: "@",
|
|
110
|
+
type: "MX",
|
|
111
|
+
address: "mail.example.com",
|
|
112
|
+
mxPref: 10,
|
|
113
|
+
ttl: 300,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
hostname: "@",
|
|
117
|
+
type: "TXT",
|
|
118
|
+
address: "v=spf1 include:_spf.google.com ~all",
|
|
119
|
+
ttl: 300,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Advanced Configuration with Email Setup
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
import * as namecheap from "pulumi-namecheap";
|
|
129
|
+
|
|
130
|
+
const domainRecords = new namecheap.DomainRecords("example-domain", {
|
|
131
|
+
domain: "example.com",
|
|
132
|
+
emailType: "GMAIL", // Configure Gmail for email
|
|
133
|
+
mode: "MERGE",
|
|
134
|
+
records: [
|
|
135
|
+
// A record for root domain
|
|
136
|
+
{
|
|
137
|
+
hostname: "@",
|
|
138
|
+
type: "A",
|
|
139
|
+
address: "203.0.113.1",
|
|
140
|
+
ttl: 1800,
|
|
141
|
+
},
|
|
142
|
+
// CNAME for www subdomain
|
|
143
|
+
{
|
|
144
|
+
hostname: "www",
|
|
145
|
+
type: "CNAME",
|
|
146
|
+
address: "example.com",
|
|
147
|
+
ttl: 1800,
|
|
148
|
+
},
|
|
149
|
+
// Multiple MX records for redundancy
|
|
150
|
+
{
|
|
151
|
+
hostname: "@",
|
|
152
|
+
type: "MX",
|
|
153
|
+
address: "aspmx.l.google.com",
|
|
154
|
+
mxPref: 1,
|
|
155
|
+
ttl: 3600,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
hostname: "@",
|
|
159
|
+
type: "MX",
|
|
160
|
+
address: "alt1.aspmx.l.google.com",
|
|
161
|
+
mxPref: 5,
|
|
162
|
+
ttl: 3600,
|
|
163
|
+
},
|
|
164
|
+
// TXT record for domain verification
|
|
165
|
+
{
|
|
166
|
+
hostname: "@",
|
|
167
|
+
type: "TXT",
|
|
168
|
+
address: "google-site-verification=your-verification-string",
|
|
169
|
+
ttl: 3600,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// Export the domain records ID
|
|
175
|
+
export const domainRecordsId = domainRecords.domainRecordsId;
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Using Custom Provider Instance
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
import * as namecheap from "pulumi-namecheap";
|
|
182
|
+
|
|
183
|
+
// Create a custom provider for sandbox testing
|
|
184
|
+
const sandboxProvider = new namecheap.Provider("sandbox-provider", {
|
|
185
|
+
apiKey: "your-sandbox-api-key",
|
|
186
|
+
apiUser: "your-api-user",
|
|
187
|
+
userName: "your-username",
|
|
188
|
+
clientIp: "your-client-ip",
|
|
189
|
+
useSandbox: true,
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// Use the custom provider
|
|
193
|
+
const testRecords = new namecheap.DomainRecords("test-records", {
|
|
194
|
+
domain: "test-domain.com",
|
|
195
|
+
records: [
|
|
196
|
+
{
|
|
197
|
+
hostname: "test",
|
|
198
|
+
type: "A",
|
|
199
|
+
address: "192.168.1.1",
|
|
200
|
+
ttl: 300,
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
}, { provider: sandboxProvider });
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Resources
|
|
207
|
+
|
|
208
|
+
### DomainRecords
|
|
209
|
+
|
|
210
|
+
Manages DNS records for a Namecheap domain.
|
|
211
|
+
|
|
212
|
+
#### Properties
|
|
213
|
+
|
|
214
|
+
- **domain** (Required): The domain name to manage records for
|
|
215
|
+
- **records** (Optional): Array of DNS record configurations
|
|
216
|
+
- **emailType** (Optional): Email service configuration (`NONE`, `MXE`, `MX`, `FWD`, `OX`, `GMAIL`)
|
|
217
|
+
- **mode** (Optional): How to handle existing records (`MERGE` or `OVERWRITE`)
|
|
218
|
+
- **nameservers** (Optional): Custom nameservers for the domain
|
|
219
|
+
|
|
220
|
+
#### Record Types
|
|
221
|
+
|
|
222
|
+
Each record in the `records` array supports:
|
|
223
|
+
|
|
224
|
+
- **hostname** (Required): The subdomain/hostname for the record
|
|
225
|
+
- **type** (Required): Record type (`A`, `AAAA`, `ALIAS`, `CAA`, `CNAME`, `MX`, `MXE`, `NS`, `TXT`, `URL`, `URL301`, `FRAME`)
|
|
226
|
+
- **address** (Required): The target IP address or hostname
|
|
227
|
+
- **ttl** (Optional): Time to live (60-60000 seconds)
|
|
228
|
+
- **mxPref** (Optional): MX record priority (required for MX records)
|
|
229
|
+
|
|
230
|
+
## API Reference
|
|
231
|
+
|
|
232
|
+
For detailed API documentation, see the generated documentation in your IDE or visit the [Pulumi Registry](https://www.pulumi.com/registry/).
|
|
233
|
+
|
|
234
|
+
## Authentication Setup
|
|
235
|
+
|
|
236
|
+
### Getting Your API Credentials
|
|
237
|
+
|
|
238
|
+
1. **Log in to Namecheap**: Go to your Namecheap account dashboard
|
|
239
|
+
2. **Enable API Access**: Navigate to Profile → Tools → Namecheap API Access
|
|
240
|
+
3. **Generate API Key**: Create a new API key for your application
|
|
241
|
+
4. **Whitelist IP**: Add your client IP address to the whitelist
|
|
242
|
+
5. **Note Your Details**: Save your API key, username, and API user name
|
|
243
|
+
|
|
244
|
+
### Testing in Sandbox
|
|
245
|
+
|
|
246
|
+
Namecheap provides a sandbox environment for testing. Set `useSandbox: true` in your provider configuration to use the sandbox API endpoints.
|
|
247
|
+
|
|
248
|
+
## Examples
|
|
249
|
+
|
|
250
|
+
You can find more examples in the [examples directory](./examples) or check out these common use cases:
|
|
251
|
+
|
|
252
|
+
- [Basic A/CNAME Records](./examples/basic-records)
|
|
253
|
+
- [Email Configuration](./examples/email-setup)
|
|
254
|
+
- [Multi-domain Management](./examples/multiple-domains)
|
|
255
|
+
- [Sandbox Testing](./examples/sandbox-testing)
|
|
256
|
+
|
|
257
|
+
## Support
|
|
258
|
+
|
|
259
|
+
This provider is a derived work of the [Terraform Provider](https://github.com/namecheap/terraform-provider-namecheap) distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/).
|
|
260
|
+
|
|
261
|
+
If you encounter a bug or missing feature, please consult the source [`terraform-provider-namecheap` repo](https://github.com/namecheap/terraform-provider-namecheap/issues).
|
|
262
|
+
|
|
263
|
+
For Pulumi-specific issues, please open an issue in the [pulumi-any-terraform repository](https://github.com/hckhanh/pulumi-any-terraform).
|
|
264
|
+
|
|
265
|
+
## License
|
|
266
|
+
|
|
267
|
+
This package is distributed under the MIT License. The underlying Terraform provider is distributed under MPL 2.0.
|
package/bin/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pulumi-namecheap",
|
|
3
|
-
"description": "A Pulumi provider dynamically bridged from
|
|
4
|
-
"version": "2.2.
|
|
3
|
+
"description": "A Pulumi provider for managing Namecheap domain records and DNS configuration, dynamically bridged from the Terraform Namecheap provider with support for A, AAAA, CNAME, MX, TXT records and email services.",
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"homepage": "https://github.com/hckhanh/pulumi-any-terraform",
|
|
6
|
-
"repository":
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/hckhanh/pulumi-any-terraform.git",
|
|
9
|
+
"directory": "packages/namecheap"
|
|
10
|
+
},
|
|
7
11
|
"private": false,
|
|
8
12
|
"main": "./bin/index.mjs",
|
|
9
13
|
"module": "./bin/index.mjs",
|
|
@@ -18,8 +22,8 @@
|
|
|
18
22
|
"devDependencies": {
|
|
19
23
|
"@pulumi/pulumi": "3.188.0",
|
|
20
24
|
"@types/node": "22.17.1",
|
|
21
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
22
|
-
"tsdown": "0.13.
|
|
25
|
+
"@typescript/native-preview": "7.0.0-dev.20250807.1",
|
|
26
|
+
"tsdown": "0.13.3",
|
|
23
27
|
"typescript": "5.9.2"
|
|
24
28
|
},
|
|
25
29
|
"peerDependencies": {
|
|
@@ -29,13 +33,26 @@
|
|
|
29
33
|
"bin",
|
|
30
34
|
"README.md"
|
|
31
35
|
],
|
|
36
|
+
"keywords": [
|
|
37
|
+
"pulumi",
|
|
38
|
+
"namecheap",
|
|
39
|
+
"dns",
|
|
40
|
+
"domain",
|
|
41
|
+
"records",
|
|
42
|
+
"terraform",
|
|
43
|
+
"provider",
|
|
44
|
+
"infrastructure",
|
|
45
|
+
"domain-management",
|
|
46
|
+
"dns-records",
|
|
47
|
+
"email-service"
|
|
48
|
+
],
|
|
32
49
|
"pulumi": {
|
|
33
50
|
"resource": true,
|
|
34
51
|
"name": "terraform-provider",
|
|
35
52
|
"version": "0.8.0",
|
|
36
53
|
"parameterization": {
|
|
37
54
|
"name": "namecheap",
|
|
38
|
-
"version": "2.2.
|
|
55
|
+
"version": "2.2.1",
|
|
39
56
|
"value": "eyJyZW1vdGUiOnsidXJsIjoicmVnaXN0cnkub3BlbnRvZnUub3JnL25hbWVjaGVhcC9uYW1lY2hlYXAiLCJ2ZXJzaW9uIjoiMi4yLjAifX0="
|
|
40
57
|
}
|
|
41
58
|
}
|
package/bin/package.mjs
CHANGED
|
@@ -4,10 +4,14 @@ import { __commonJS } from "./_virtual/rolldown_runtime.mjs";
|
|
|
4
4
|
var require_package = /* @__PURE__ */ __commonJS({ "package.json": ((exports, module) => {
|
|
5
5
|
module.exports = {
|
|
6
6
|
"name": "pulumi-namecheap",
|
|
7
|
-
"description": "A Pulumi provider dynamically bridged from
|
|
8
|
-
"version": "2.2.
|
|
7
|
+
"description": "A Pulumi provider for managing Namecheap domain records and DNS configuration, dynamically bridged from the Terraform Namecheap provider with support for A, AAAA, CNAME, MX, TXT records and email services.",
|
|
8
|
+
"version": "2.2.1",
|
|
9
9
|
"homepage": "https://github.com/hckhanh/pulumi-any-terraform",
|
|
10
|
-
"repository":
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/hckhanh/pulumi-any-terraform.git",
|
|
13
|
+
"directory": "packages/namecheap"
|
|
14
|
+
},
|
|
11
15
|
"private": false,
|
|
12
16
|
"main": "./bin/index.mjs",
|
|
13
17
|
"module": "./bin/index.mjs",
|
|
@@ -20,19 +24,32 @@ var require_package = /* @__PURE__ */ __commonJS({ "package.json": ((exports, mo
|
|
|
20
24
|
"devDependencies": {
|
|
21
25
|
"@pulumi/pulumi": "3.188.0",
|
|
22
26
|
"@types/node": "22.17.1",
|
|
23
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
24
|
-
"tsdown": "0.13.
|
|
27
|
+
"@typescript/native-preview": "7.0.0-dev.20250807.1",
|
|
28
|
+
"tsdown": "0.13.3",
|
|
25
29
|
"typescript": "5.9.2"
|
|
26
30
|
},
|
|
27
31
|
"peerDependencies": { "@pulumi/pulumi": ">=3.188.0" },
|
|
28
32
|
"files": ["bin", "README.md"],
|
|
33
|
+
"keywords": [
|
|
34
|
+
"pulumi",
|
|
35
|
+
"namecheap",
|
|
36
|
+
"dns",
|
|
37
|
+
"domain",
|
|
38
|
+
"records",
|
|
39
|
+
"terraform",
|
|
40
|
+
"provider",
|
|
41
|
+
"infrastructure",
|
|
42
|
+
"domain-management",
|
|
43
|
+
"dns-records",
|
|
44
|
+
"email-service"
|
|
45
|
+
],
|
|
29
46
|
"pulumi": {
|
|
30
47
|
"resource": true,
|
|
31
48
|
"name": "terraform-provider",
|
|
32
49
|
"version": "0.8.0",
|
|
33
50
|
"parameterization": {
|
|
34
51
|
"name": "namecheap",
|
|
35
|
-
"version": "2.2.
|
|
52
|
+
"version": "2.2.1",
|
|
36
53
|
"value": "eyJyZW1vdGUiOnsidXJsIjoicmVnaXN0cnkub3BlbnRvZnUub3JnL25hbWVjaGVhcC9uYW1lY2hlYXAiLCJ2ZXJzaW9uIjoiMi4yLjAifX0="
|
|
37
54
|
}
|
|
38
55
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pulumi-namecheap",
|
|
3
|
-
"description": "A Pulumi provider dynamically bridged from
|
|
4
|
-
"version": "2.2.
|
|
3
|
+
"description": "A Pulumi provider for managing Namecheap domain records and DNS configuration, dynamically bridged from the Terraform Namecheap provider with support for A, AAAA, CNAME, MX, TXT records and email services.",
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"homepage": "https://github.com/hckhanh/pulumi-any-terraform",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@pulumi/pulumi": "3.188.0",
|
|
24
24
|
"@types/node": "22.17.1",
|
|
25
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
26
|
-
"tsdown": "0.13.
|
|
25
|
+
"@typescript/native-preview": "7.0.0-dev.20250807.1",
|
|
26
|
+
"tsdown": "0.13.3",
|
|
27
27
|
"typescript": "5.9.2"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -33,14 +33,27 @@
|
|
|
33
33
|
"bin",
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
|
+
"keywords": [
|
|
37
|
+
"pulumi",
|
|
38
|
+
"namecheap",
|
|
39
|
+
"dns",
|
|
40
|
+
"domain",
|
|
41
|
+
"records",
|
|
42
|
+
"terraform",
|
|
43
|
+
"provider",
|
|
44
|
+
"infrastructure",
|
|
45
|
+
"domain-management",
|
|
46
|
+
"dns-records",
|
|
47
|
+
"email-service"
|
|
48
|
+
],
|
|
36
49
|
"pulumi": {
|
|
37
50
|
"resource": true,
|
|
38
51
|
"name": "terraform-provider",
|
|
39
52
|
"version": "0.8.0",
|
|
40
53
|
"parameterization": {
|
|
41
54
|
"name": "namecheap",
|
|
42
|
-
"version": "2.2.
|
|
55
|
+
"version": "2.2.1",
|
|
43
56
|
"value": "eyJyZW1vdGUiOnsidXJsIjoicmVnaXN0cnkub3BlbnRvZnUub3JnL25hbWVjaGVhcC9uYW1lY2hlYXAiLCJ2ZXJzaW9uIjoiMi4yLjAifX0="
|
|
44
57
|
}
|
|
45
58
|
}
|
|
46
|
-
}
|
|
59
|
+
}
|