Skip to content

Commit

Permalink
Update GitHub Actions workflows. (#364)
Browse files Browse the repository at this point in the history
This PR was automatically generated by the
update-workflows-ecosystem-providers workflow in the pulumi/ci-mgmt
repo, from commit 6ac78e5c5cbd53bee8e951f48779dbe39b73a9bc.

---------

Co-authored-by: Ian Wahbe <ian@wahbe.com>
  • Loading branch information
pulumi-bot and iwahbe authored Jan 20, 2024
1 parent b54bbaf commit 3e91194
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 74 deletions.
1 change: 1 addition & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
github.com/cloudflare/circl,
github.com/golang,
github.com/gorhill/cronexpr,
github.com/in-toto/in-toto-golang,
github.com/jmespath/go-jmespath,
github.com/keybase/go-crypto,
github.com/klauspost/compress,
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,6 @@ jobs:
name: run-acceptance-tests
on:
pull_request:
branches:
- master
- v*
- feature*
paths-ignore:
- CHANGELOG.md
repository_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
if: github.event_name == 'repository_dispatch'
uses: pulumi/pulumi-upgrade-provider-action@v0.0.11
with:
kind: ${{ inputs.kind }}
kind: ${{ github.event.client_payload.kind || 'bridge' }}
email: bot@pulumi.com
username: pulumi-bot
automerge: ${{ github.event.client_payload.automerge }}
Expand Down
140 changes: 79 additions & 61 deletions examples/virtualappliance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,103 @@ import * as f5bigip from "@pulumi/f5bigip";
import * as virtualappliance from "./virtualappliance";
import * as backendinstances from "./loadbalancedinstances";
import * as https from "https";
import fetch from "node-fetch";
import * as fetch from "node-fetch";

function sleep(ms: number) : Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
function sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}

// Wait for the virtual appliance to be avaiabe to log in to.
const virtualapplicanceAddress = pulumi.all([virtualappliance.f5Address, virtualappliance.f5Password])
.apply(async ([address,password]) => {
let ready = false;
const agent = new https.Agent({
rejectUnauthorized: false
});
const token = Buffer.from(`admin:${password}`).toString("base64");
while (!ready) {
try {
const res = await fetch(`${address}/mgmt/tm/ltm`, {
agent,
headers: {
Authorization: `Basic ${token}`,
},
});
if (res.status == 200) {
console.log("bigip virtual appliance is ready")
ready = true;
}

} catch (err) {
console.log(`caught exception: ${err}`)
const virtualapplicanceAddress = pulumi
.all([virtualappliance.f5Address, virtualappliance.f5Password])
.apply(async ([address, password]) => {
let ready = false;
const agent = new https.Agent({
rejectUnauthorized: false,
});
const token = Buffer.from(`admin:${password}`).toString("base64");
while (!ready) {
try {
const res = await fetch(`${address}/mgmt/tm/ltm`, {
agent,
headers: {
Authorization: `Basic ${token}`,
},
});
if (res.status == 200) {
console.log("bigip virtual appliance is ready");
ready = true;
}
} catch (err) {
console.log(`caught exception: ${err}`);
}
// Keep trying
console.log("waiting for bigip virtual appliance address to be ready");
sleep(10000);
}
// Keep trying
console.log("waiting for bigip virtual appliance address to be ready")
sleep(10000);
}
return address;
});
return address;
});

const f5bigipProvider = new f5bigip.Provider("bigipProvider", {
address: virtualapplicanceAddress,
password: virtualappliance.f5Password,
username: "admin",
});

const monitor = new f5bigip.ltm.Monitor("backend", {
name: "/Common/backend",
parent: "/Common/http",
send: "GET /\r\n",
timeout: 5,
interval: 10,
}, { provider: f5bigipProvider });
const monitor = new f5bigip.ltm.Monitor(
"backend",
{
name: "/Common/backend",
parent: "/Common/http",
send: "GET /\r\n",
timeout: 5,
interval: 10,
},
{ provider: f5bigipProvider },
);

const pool = new f5bigip.ltm.Pool("backend", {
name: "/Common/backend",
monitors: [monitor.name],
allowNat: "yes",
allowSnat: "yes",
}, { provider: f5bigipProvider });
const pool = new f5bigip.ltm.Pool(
"backend",
{
name: "/Common/backend",
monitors: [monitor.name],
allowNat: "yes",
allowSnat: "yes",
},
{ provider: f5bigipProvider },
);

backendinstances.instancePublicIps.map((backendAddress, i) => {
const node = new f5bigip.ltm.Node(
`backend-${i}`,
{
name: `/Common/node-${i}`,
address: backendAddress.apply((x) => x.toString()),
},
{ provider: f5bigipProvider },
);

const node = new f5bigip.ltm.Node(`backend-${i}`, {
name: `/Common/node-${i}`,
address: backendAddress.apply(x=>x.toString()),
}, { provider: f5bigipProvider })

const applicationPoolAttachment = new f5bigip.ltm.PoolAttachment(`backend-${i}`, {
pool: pool.name,
node: node.name.apply( x => x + ":80"),
}, { provider: f5bigipProvider });

new f5bigip.ltm.PoolAttachment(
`backend-${i}`,
{
pool: pool.name,
node: node.name.apply((x: string) => x + ":80"),
},
{ provider: f5bigipProvider },
);
});

const virtualServer = new f5bigip.ltm.VirtualServer("backend", {
pool: pool.name,
name: "/Common/backend",
destination: virtualappliance.f5PrivateIp,
port: 80,
sourceAddressTranslation: "automap",
}, { provider: f5bigipProvider, dependsOn: [pool] });
new f5bigip.ltm.VirtualServer(
"backend",
{
pool: pool.name,
name: "/Common/backend",
destination: virtualappliance.f5PrivateIp,
port: 80,
sourceAddressTranslation: "automap",
},
{ provider: f5bigipProvider, dependsOn: [pool] },
);

export let instanceIp = virtualappliance.f5Address;
export let password = virtualappliance.f5Password;
2 changes: 1 addition & 1 deletion examples/virtualappliance/loadbalancedinstances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const baseTags = {
project: `${pulumi.getProject()}-${pulumi.getStack()}`,
};

const ubuntuAmiId = aws.getAmi({
const ubuntuAmiId = aws.ec2.getAmi({
mostRecent: true,
nameRegex: "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*",
owners: ["099720109477"],
Expand Down
12 changes: 6 additions & 6 deletions examples/virtualappliance/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "virtualappliance",
"devDependencies": {
"@types/node": "latest"
"@types/node": "^20.11.0",
"@types/node-fetch": "2.6.11"
},
"dependencies": {
"@pulumi/aws": "^4.0.0-alpha.0",
"@pulumi/pulumi": "^3.0.0-alpha.0",
"@pulumi/random": "^4.0.0-alpha.0",
"@types/node-fetch": "^2.1.4",
"node-fetch": "^2.3.0"
"@pulumi/aws": "^6.0.0",
"@pulumi/pulumi": "^3.0.0",
"@pulumi/random": "^4.0.0",
"node-fetch": "2.6.11"
}
}
2 changes: 1 addition & 1 deletion examples/virtualappliance/virtualappliance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const firewall = new aws.ec2.SecurityGroup("bigIp", {
* If the subscription is missing, the test will fail with a helpful error message and a
* link to subscribe.
*/
const bigIpAmiId = aws.getAmi({
const bigIpAmiId = aws.ec2.getAmi({
mostRecent: true,
owners: ["679593333241"],
filters: [
Expand Down

0 comments on commit 3e91194

Please sign in to comment.