Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tuts/001-lightsail-gs/javascript/libs/lightsail-wrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { LightsailClient, CreateDiskCommand, CreateInstancesCommand, DeleteDiskCommand, DeleteInstanceCommand, GetInstanceCommand } from "@aws-sdk/client-lightsail";

export const createInstances = async (client, params) => {
const command = new CreateInstancesCommand(params);
return client.send(command);
};
export const createDisk = async (client, params) => {
const command = new CreateDiskCommand(params);
return client.send(command);
};
export const getInstance = async (client, params) => {
const command = new GetInstanceCommand(params);
return client.send(command);
};
export const deleteInstance = async (client, params) => {
const command = new DeleteInstanceCommand(params);
return client.send(command);
};
export const deleteDisk = async (client, params) => {
const command = new DeleteDiskCommand(params);
return client.send(command);
};
14 changes: 14 additions & 0 deletions tuts/001-lightsail-gs/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "tutorial-lightsail",
"type": "module",
"scripts": {
"test": "vitest run"
},
"dependencies": {
"@aws-sdk/client-lightsail": "latest"
},
"devDependencies": {
"vitest": "latest",
"aws-sdk-client-mock": "latest"
}
}
15 changes: 15 additions & 0 deletions tuts/001-lightsail-gs/javascript/scenarios/getting-started.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { LightsailClient } from "@aws-sdk/client-lightsail";
import { randomUUID } from "crypto";

const main = async () => {
const client = new LightsailClient({});
const suffix = randomUUID().slice(0, 8);
console.log("Running lightsail getting started scenario...");
// TODO: implement setup, interact, teardown
console.log("Scenario complete.");
};

main();
16 changes: 16 additions & 0 deletions tuts/001-lightsail-gs/javascript/tests/lightsail.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { describe, it, expect, beforeEach } from "vitest";
import { mockClient } from "aws-sdk-client-mock";
import { LightsailClient } from "@aws-sdk/client-lightsail";

const mock = mockClient(LightsailClient);

describe("lightsail wrapper", () => {
beforeEach(() => mock.reset());

it("placeholder test", () => {
expect(true).toBe(true);
});
});
5 changes: 5 additions & 0 deletions tuts/002-vpc-gs/javascript/libs/ec2-wrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { EC2Client } from "@aws-sdk/client-ec2";
// TODO: Add wrapper functions matching CLI tutorial actions
14 changes: 14 additions & 0 deletions tuts/002-vpc-gs/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "tutorial-ec2",
"type": "module",
"scripts": {
"test": "vitest run"
},
"dependencies": {
"@aws-sdk/client-ec2": "latest"
},
"devDependencies": {
"vitest": "latest",
"aws-sdk-client-mock": "latest"
}
}
15 changes: 15 additions & 0 deletions tuts/002-vpc-gs/javascript/scenarios/getting-started.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { EC2Client } from "@aws-sdk/client-ec2";
import { randomUUID } from "crypto";

const main = async () => {
const client = new EC2Client({});
const suffix = randomUUID().slice(0, 8);
console.log("Running ec2 getting started scenario...");
// TODO: implement setup, interact, teardown
console.log("Scenario complete.");
};

main();
16 changes: 16 additions & 0 deletions tuts/002-vpc-gs/javascript/tests/ec2.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { describe, it, expect, beforeEach } from "vitest";
import { mockClient } from "aws-sdk-client-mock";
import { EC2Client } from "@aws-sdk/client-ec2";

const mock = mockClient(EC2Client);

describe("ec2 wrapper", () => {
beforeEach(() => mock.reset());

it("placeholder test", () => {
expect(true).toBe(true);
});
});
33 changes: 33 additions & 0 deletions tuts/003-s3-gettingstarted/javascript/libs/s3-wrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { S3Client, CopyObjectCommand, CreateBucketCommand, DeleteBucketCommand, DeleteObjectsCommand, GetObjectCommand, ListObjectsV2Command, PutObjectCommand } from "@aws-sdk/client-s3";

export const createBucket = async (client, params) => {
const command = new CreateBucketCommand(params);
return client.send(command);
};
export const putObject = async (client, params) => {
const command = new PutObjectCommand(params);
return client.send(command);
};
export const getObject = async (client, params) => {
const command = new GetObjectCommand(params);
return client.send(command);
};
export const copyObject = async (client, params) => {
const command = new CopyObjectCommand(params);
return client.send(command);
};
export const listObjects = async (client, params) => {
const command = new ListObjectsV2Command(params);
return client.send(command);
};
export const deleteObjects = async (client, params) => {
const command = new DeleteObjectsCommand(params);
return client.send(command);
};
export const deleteBucket = async (client, params) => {
const command = new DeleteBucketCommand(params);
return client.send(command);
};
14 changes: 14 additions & 0 deletions tuts/003-s3-gettingstarted/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "tutorial-s3",
"type": "module",
"scripts": {
"test": "vitest run"
},
"dependencies": {
"@aws-sdk/client-s3": "latest"
},
"devDependencies": {
"vitest": "latest",
"aws-sdk-client-mock": "latest"
}
}
15 changes: 15 additions & 0 deletions tuts/003-s3-gettingstarted/javascript/scenarios/getting-started.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { S3Client } from "@aws-sdk/client-s3";
import { randomUUID } from "crypto";

const main = async () => {
const client = new S3Client({});
const suffix = randomUUID().slice(0, 8);
console.log("Running s3 getting started scenario...");
// TODO: implement setup, interact, teardown
console.log("Scenario complete.");
};

main();
16 changes: 16 additions & 0 deletions tuts/003-s3-gettingstarted/javascript/tests/s3.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { describe, it, expect, beforeEach } from "vitest";
import { mockClient } from "aws-sdk-client-mock";
import { S3Client } from "@aws-sdk/client-s3";

const mock = mockClient(S3Client);

describe("s3 wrapper", () => {
beforeEach(() => mock.reset());

it("placeholder test", () => {
expect(true).toBe(true);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { ServiceDiscoveryClient } from "@aws-sdk/client-servicediscovery";
// TODO: Add wrapper functions matching CLI tutorial actions
14 changes: 14 additions & 0 deletions tuts/004-cloudmap-custom-attributes/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "tutorial-servicediscovery",
"type": "module",
"scripts": {
"test": "vitest run"
},
"dependencies": {
"@aws-sdk/client-servicediscovery": "latest"
},
"devDependencies": {
"vitest": "latest",
"aws-sdk-client-mock": "latest"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { ServiceDiscoveryClient } from "@aws-sdk/client-servicediscovery";
import { randomUUID } from "crypto";

const main = async () => {
const client = new ServiceDiscoveryClient({});
const suffix = randomUUID().slice(0, 8);
console.log("Running servicediscovery getting started scenario...");
// TODO: implement setup, interact, teardown
console.log("Scenario complete.");
};

main();
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { describe, it, expect, beforeEach } from "vitest";
import { mockClient } from "aws-sdk-client-mock";
import { ServiceDiscoveryClient } from "@aws-sdk/client-servicediscovery";

const mock = mockClient(ServiceDiscoveryClient);

describe("servicediscovery wrapper", () => {
beforeEach(() => mock.reset());

it("placeholder test", () => {
expect(true).toBe(true);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { CloudFrontClient } from "@aws-sdk/client-cloudfront";
// TODO: Add wrapper functions matching CLI tutorial actions
14 changes: 14 additions & 0 deletions tuts/005-cloudfront-gettingstarted/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "tutorial-cloudfront",
"type": "module",
"scripts": {
"test": "vitest run"
},
"dependencies": {
"@aws-sdk/client-cloudfront": "latest"
},
"devDependencies": {
"vitest": "latest",
"aws-sdk-client-mock": "latest"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { CloudFrontClient } from "@aws-sdk/client-cloudfront";
import { randomUUID } from "crypto";

const main = async () => {
const client = new CloudFrontClient({});
const suffix = randomUUID().slice(0, 8);
console.log("Running cloudfront getting started scenario...");
// TODO: implement setup, interact, teardown
console.log("Scenario complete.");
};

main();
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { describe, it, expect, beforeEach } from "vitest";
import { mockClient } from "aws-sdk-client-mock";
import { CloudFrontClient } from "@aws-sdk/client-cloudfront";

const mock = mockClient(CloudFrontClient);

describe("cloudfront wrapper", () => {
beforeEach(() => mock.reset());

it("placeholder test", () => {
expect(true).toBe(true);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { EC2Client } from "@aws-sdk/client-ec2";
// TODO: Add wrapper functions matching CLI tutorial actions
14 changes: 14 additions & 0 deletions tuts/008-vpc-private-servers-gs/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "tutorial-ec2",
"type": "module",
"scripts": {
"test": "vitest run"
},
"dependencies": {
"@aws-sdk/client-ec2": "latest"
},
"devDependencies": {
"vitest": "latest",
"aws-sdk-client-mock": "latest"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { EC2Client } from "@aws-sdk/client-ec2";
import { randomUUID } from "crypto";

const main = async () => {
const client = new EC2Client({});
const suffix = randomUUID().slice(0, 8);
console.log("Running ec2 getting started scenario...");
// TODO: implement setup, interact, teardown
console.log("Scenario complete.");
};

main();
16 changes: 16 additions & 0 deletions tuts/008-vpc-private-servers-gs/javascript/tests/ec2.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { describe, it, expect, beforeEach } from "vitest";
import { mockClient } from "aws-sdk-client-mock";
import { EC2Client } from "@aws-sdk/client-ec2";

const mock = mockClient(EC2Client);

describe("ec2 wrapper", () => {
beforeEach(() => mock.reset());

it("placeholder test", () => {
expect(true).toBe(true);
});
});
5 changes: 5 additions & 0 deletions tuts/009-vpc-ipam-gs/javascript/libs/ec2-wrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { EC2Client } from "@aws-sdk/client-ec2";
// TODO: Add wrapper functions matching CLI tutorial actions
14 changes: 14 additions & 0 deletions tuts/009-vpc-ipam-gs/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "tutorial-ec2",
"type": "module",
"scripts": {
"test": "vitest run"
},
"dependencies": {
"@aws-sdk/client-ec2": "latest"
},
"devDependencies": {
"vitest": "latest",
"aws-sdk-client-mock": "latest"
}
}
Loading
Loading