Skip to content

Commit

Permalink
feat: sync latest tf version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Anaya committed Jun 14, 2022
1 parent 185f921 commit c3aa9f8
Show file tree
Hide file tree
Showing 20 changed files with 98 additions and 101 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@ install_sdks:: install_dotnet_sdk install_python_sdk install_nodejs_sdk
test::
cd examples && go test -v -tags=all -parallel ${TESTPARALLELISM} -timeout 2h

do::
sync::
make tfgen
make provider
make build_sdks

do::
make sync
cp bin/pulumi-resource-checkly ${GOPATH}/bin
make install_nodejs_sdk
cd examples/js && yarn link @checkly/pulumi && cd -
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/AlertChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Check.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/CheckGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Dashboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/EnvironmentVariable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/MaintenanceWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Snippet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/TriggerCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/TriggerCheckGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}",
PluginDownloadURL = "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static InvokeOptions WithDefaults(this InvokeOptions? src)
{
InvokeOptions dst = src ?? new InvokeOptions{};
dst.Version = src?.Version ?? Version;
dst.PluginDownloadURL = src?.PluginDownloadURL ?? "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}";
dst.PluginDownloadURL = src?.PluginDownloadURL ?? "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}";
return dst;
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"resource": true,
"name": "checkly",
"server": "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"
"server": "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}"
}
2 changes: 1 addition & 1 deletion sdk/dotnet/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1+dirty
0.0.3-alpha.1655222003.dirty
2 changes: 1 addition & 1 deletion sdk/go/checkly/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"resource": true,
"name": "checkly",
"server": "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"
"server": "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}"
}
4 changes: 2 additions & 2 deletions sdk/go/checkly/pulumiUtilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ func isZero(v interface{}) bool {

// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource.
func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption {
defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}")}
defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}")}

return append(defaults, opts...)
}

// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke.
func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption {
defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}")}
defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}")}

return append(defaults, opts...)
}
156 changes: 75 additions & 81 deletions sdk/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
</p>

![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/checkly/pulumi-checkly?label=Version)

The Checkly Pulumi provider enables you to create and configure Checkly resources using your favourite programming language.
Note that this project is in its early stages and breaking changes could happen.
Expand All @@ -15,22 +16,11 @@ Note that this project is in its early stages and breaking changes could happen.

### Node.js (JavaScript/TypeScript)

To use from JavaScript or TypeScript in Node.js, install using either `npm`:
To use from JavaScript or TypeScript in Node.js, install using either `npm` or `yarn`:

```bash
npm install @checkly/pulumi
```

or `yarn`:

```bash
yarn add @checkly/pulumi
```

Install the provider binary plugin. This is only needed due to an outstanding bug in with Pulumi registry

```bash
pulumi plugin install resource checkly v0.0.1-alpha.9 --server https://github.com/checkly/pulumi-checkly/releases/download/v0.0.1-alpha.9
$ npm install @checkly/pulumi
$ yarn add @checkly/pulumi
```

### Python, Go & .NET
Expand Down Expand Up @@ -59,94 +49,98 @@ Once you generated the `API Key` there are two ways to communicate your authoriz

> Remember to pass `--secret` when setting `checkly:apiKey` so it is properly encrypted.

## Creating Resources

The example below shows a basic API check and Browser check.

```javascript
// index.js
const checkly = require("@checkly/pulumi")
new checkly.Check("api-check", {
type: "API",
name: "Public SpaceX API",
activated: true,
frequency: 10,
locations: ["us-east-1"],
request: {
method: "GET",
url: "https://api.spacexdata.com/v3",
assertions: [
{
source: 'STATUS_CODE',
comparison: 'EQUALS',
target: 200
},
{
source: 'JSON_BODY',
property: '$.project_name',
comparison: 'EQUALS',
target: 'SpaceX-API'
## Getting Started

1. Open your terminal and run `$ pulumi new` to create a new Pulumi project, chose the `javascript` template and the target stack.
1. Install the Checkly Pulumi provider using npm: `$ npm i @checkly/pulumi`.
1. Create an `index.js` file in the root of your project and paste the following code:

```javascript
const checkly = require("@checkly/pulumi")
new checkly.Check("api-check", {
type: "API",
name: "Public SpaceX API",
activated: true,
frequency: 10,
locations: ["us-east-1"],
request: {
method: "GET",
url: "https://api.spacexdata.com/v3",
assertions: [
{
source: 'STATUS_CODE',
comparison: 'EQUALS',
target: 200
},
{
source: 'JSON_BODY',
property: '$.project_name',
comparison: 'EQUALS',
target: 'SpaceX-API'
}
]
}
]
}
})
})
new checkly.Check("browser-check", {
type: "BROWSER",
name: "Google.com Playwright check",
activated: true,
frequency: 10,
locations: ["us-east-1"],
script: `const { chromium } = require('playwright')
new checkly.Check("browser-check", {
type: "BROWSER",
name: "Google.com Playwright check",
activated: true,
frequency: 10,
locations: ["us-east-1"],
script: `const { chromium } = require('playwright')
async function run () {
const browser = await chromium.launch()
const page = await browser.newPage()
async function run () {
const browser = await chromium.launch()
const page = await browser.newPage()
const response = await page.goto('https://google.com')
const response = await page.goto('https://google.com')
if (response.status() > 399) {
throw new Error('Failed with response code \${response.status()}')
}
if (response.status() > 399) {
throw new Error('Failed with response code \${response.status()}')
}
await page.screenshot({ path: 'screenshot.jpg' })
await page.screenshot({ path: 'screenshot.jpg' })
await page.close()
await browser.close()
}
await page.close()
await browser.close()
}
run()`
})
```
run()`
})
```
1. Setup you Checkly API Key and Account id:
```bash
$ pulumi config set checkly:apiKey cu_xxx --secret
$ pulumi config set checkly:accountId xxx
```
1. You are ready to go, run `$ pulumi up` to deploy your stack 🚀
> Check the [examples directory](https://github.com/checkly/pulumi-checkly/tree/main/examples) for more detailed code samples.
## Syncing resources
Just run the regular `pulumi up` command
## Learn More
For documentation and example usage see:
1. [Checkly's documentation](https://www.checklyhq.com/docs/integrations/pulumi/).
2. [The official provider documentation](https://www.pulumi.com/registry/packages/checkly/api-docs/)
3. [Working Examples](https://github.com/checkly/pulumi-checkly/examples).
## Questions
For questions and support please open a new [discussion](https://github.com/checkly/pulumi-checkly/discussions). The issue list of this repo is exclusively for bug reports and feature/docs requests.
## Configuration
## Issues
Please make sure to respect issue requirements and choose the proper [issue template](https://github.com/checkly/pulumi-checkly/issues/new/choose) when opening an issue. Issues not conforming to the guidelines may be closed.
The following configuration points are available for the `foo` provider:
- `checkly:apiKey` (environment: `CHECKLY_API_KEY`) - the Checkly API Key.
- `checkly:accountId` (environment: `CHECKLY_ACCOUNT_ID`) - the Checkly account ID.
## Reference
For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/checkly/api-docs/).
## Contribution
Please make sure to read the [Contributing Guide](https://github.com/checkly/pulumi-checkly/blob/main/CONTRIBUTING.md) before making a pull request.
## License
[MIT](https://github.com/checkly/pulumi-checkly/blob/main/LICENSE)
<br>
<p align="center">
<a href="https://checklyhq.com?utm_source=github&utm_medium=sponsor-logo-github&utm_campaign=pulumi-checkly" target="_blank">
<a href="https://checklyhq.com?utm_source=github&utm_medium=sponsor-logo-github&utm_campaign=headless-recorder" target="_blank">
<img width="100px" src="https://www.checklyhq.com/images/text_racoon_logo.svg" alt="Checkly" />
</a>
<br />
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/pulumi_checkly/_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,4 @@ def lifted_func(*args, opts=None, **kwargs):
return (lambda _: lifted_func)

def get_plugin_download_url():
return "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"
return "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}"
2 changes: 1 addition & 1 deletion sdk/python/pulumi_checkly/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"resource": true,
"name": "checkly",
"server": "https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}"
"server": "https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}"
}
2 changes: 1 addition & 1 deletion sdk/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class InstallPluginCommand(install):
def run(self):
install.run(self)
try:
check_call(['pulumi', 'plugin', 'install', 'resource', 'checkly', PLUGIN_VERSION, '--server', 'https://github.com/checkly/pulumi-checkly/releases/download/${VERSION}'])
check_call(['pulumi', 'plugin', 'install', 'resource', 'checkly', PLUGIN_VERSION, '--server', 'https://github.com/checkly/pulumi-checkly/releases/download/v${VERSION}'])
except OSError as error:
if error.errno == errno.ENOENT:
print(f"""
Expand Down

0 comments on commit c3aa9f8

Please sign in to comment.