diff --git a/tuts/001-lightsail-gs/javascript/libs/lightsail-wrapper.js b/tuts/001-lightsail-gs/javascript/libs/lightsail-wrapper.js new file mode 100644 index 0000000..4da34d6 --- /dev/null +++ b/tuts/001-lightsail-gs/javascript/libs/lightsail-wrapper.js @@ -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); +}; diff --git a/tuts/001-lightsail-gs/javascript/package.json b/tuts/001-lightsail-gs/javascript/package.json new file mode 100644 index 0000000..e24d617 --- /dev/null +++ b/tuts/001-lightsail-gs/javascript/package.json @@ -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" + } +} \ No newline at end of file diff --git a/tuts/001-lightsail-gs/javascript/scenarios/getting-started.js b/tuts/001-lightsail-gs/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..888f681 --- /dev/null +++ b/tuts/001-lightsail-gs/javascript/scenarios/getting-started.js @@ -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(); diff --git a/tuts/001-lightsail-gs/javascript/tests/lightsail.test.js b/tuts/001-lightsail-gs/javascript/tests/lightsail.test.js new file mode 100644 index 0000000..1386bed --- /dev/null +++ b/tuts/001-lightsail-gs/javascript/tests/lightsail.test.js @@ -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); + }); +}); diff --git a/tuts/002-vpc-gs/javascript/libs/ec2-wrapper.js b/tuts/002-vpc-gs/javascript/libs/ec2-wrapper.js new file mode 100644 index 0000000..274caff --- /dev/null +++ b/tuts/002-vpc-gs/javascript/libs/ec2-wrapper.js @@ -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 diff --git a/tuts/002-vpc-gs/javascript/package.json b/tuts/002-vpc-gs/javascript/package.json new file mode 100644 index 0000000..e792181 --- /dev/null +++ b/tuts/002-vpc-gs/javascript/package.json @@ -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" + } +} \ No newline at end of file diff --git a/tuts/002-vpc-gs/javascript/scenarios/getting-started.js b/tuts/002-vpc-gs/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..8e21af3 --- /dev/null +++ b/tuts/002-vpc-gs/javascript/scenarios/getting-started.js @@ -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(); diff --git a/tuts/002-vpc-gs/javascript/tests/ec2.test.js b/tuts/002-vpc-gs/javascript/tests/ec2.test.js new file mode 100644 index 0000000..2b378c5 --- /dev/null +++ b/tuts/002-vpc-gs/javascript/tests/ec2.test.js @@ -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); + }); +}); diff --git a/tuts/003-s3-gettingstarted/javascript/libs/s3-wrapper.js b/tuts/003-s3-gettingstarted/javascript/libs/s3-wrapper.js new file mode 100644 index 0000000..2457afb --- /dev/null +++ b/tuts/003-s3-gettingstarted/javascript/libs/s3-wrapper.js @@ -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); +}; diff --git a/tuts/003-s3-gettingstarted/javascript/package.json b/tuts/003-s3-gettingstarted/javascript/package.json new file mode 100644 index 0000000..7493c98 --- /dev/null +++ b/tuts/003-s3-gettingstarted/javascript/package.json @@ -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" + } +} \ No newline at end of file diff --git a/tuts/003-s3-gettingstarted/javascript/scenarios/getting-started.js b/tuts/003-s3-gettingstarted/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..3b8cda5 --- /dev/null +++ b/tuts/003-s3-gettingstarted/javascript/scenarios/getting-started.js @@ -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(); diff --git a/tuts/003-s3-gettingstarted/javascript/tests/s3.test.js b/tuts/003-s3-gettingstarted/javascript/tests/s3.test.js new file mode 100644 index 0000000..52a0565 --- /dev/null +++ b/tuts/003-s3-gettingstarted/javascript/tests/s3.test.js @@ -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); + }); +}); diff --git a/tuts/004-cloudmap-custom-attributes/javascript/libs/servicediscovery-wrapper.js b/tuts/004-cloudmap-custom-attributes/javascript/libs/servicediscovery-wrapper.js new file mode 100644 index 0000000..14da113 --- /dev/null +++ b/tuts/004-cloudmap-custom-attributes/javascript/libs/servicediscovery-wrapper.js @@ -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 diff --git a/tuts/004-cloudmap-custom-attributes/javascript/package.json b/tuts/004-cloudmap-custom-attributes/javascript/package.json new file mode 100644 index 0000000..a1c9902 --- /dev/null +++ b/tuts/004-cloudmap-custom-attributes/javascript/package.json @@ -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" + } +} \ No newline at end of file diff --git a/tuts/004-cloudmap-custom-attributes/javascript/scenarios/getting-started.js b/tuts/004-cloudmap-custom-attributes/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..6523c5d --- /dev/null +++ b/tuts/004-cloudmap-custom-attributes/javascript/scenarios/getting-started.js @@ -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(); diff --git a/tuts/004-cloudmap-custom-attributes/javascript/tests/servicediscovery.test.js b/tuts/004-cloudmap-custom-attributes/javascript/tests/servicediscovery.test.js new file mode 100644 index 0000000..4273bc1 --- /dev/null +++ b/tuts/004-cloudmap-custom-attributes/javascript/tests/servicediscovery.test.js @@ -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); + }); +}); diff --git a/tuts/005-cloudfront-gettingstarted/javascript/libs/cloudfront-wrapper.js b/tuts/005-cloudfront-gettingstarted/javascript/libs/cloudfront-wrapper.js new file mode 100644 index 0000000..43223f0 --- /dev/null +++ b/tuts/005-cloudfront-gettingstarted/javascript/libs/cloudfront-wrapper.js @@ -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 diff --git a/tuts/005-cloudfront-gettingstarted/javascript/package.json b/tuts/005-cloudfront-gettingstarted/javascript/package.json new file mode 100644 index 0000000..a4e5929 --- /dev/null +++ b/tuts/005-cloudfront-gettingstarted/javascript/package.json @@ -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" + } +} \ No newline at end of file diff --git a/tuts/005-cloudfront-gettingstarted/javascript/scenarios/getting-started.js b/tuts/005-cloudfront-gettingstarted/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..b5b8522 --- /dev/null +++ b/tuts/005-cloudfront-gettingstarted/javascript/scenarios/getting-started.js @@ -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(); diff --git a/tuts/005-cloudfront-gettingstarted/javascript/tests/cloudfront.test.js b/tuts/005-cloudfront-gettingstarted/javascript/tests/cloudfront.test.js new file mode 100644 index 0000000..5e83a8c --- /dev/null +++ b/tuts/005-cloudfront-gettingstarted/javascript/tests/cloudfront.test.js @@ -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); + }); +}); diff --git a/tuts/008-vpc-private-servers-gs/javascript/libs/ec2-wrapper.js b/tuts/008-vpc-private-servers-gs/javascript/libs/ec2-wrapper.js new file mode 100644 index 0000000..274caff --- /dev/null +++ b/tuts/008-vpc-private-servers-gs/javascript/libs/ec2-wrapper.js @@ -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 diff --git a/tuts/008-vpc-private-servers-gs/javascript/package.json b/tuts/008-vpc-private-servers-gs/javascript/package.json new file mode 100644 index 0000000..e792181 --- /dev/null +++ b/tuts/008-vpc-private-servers-gs/javascript/package.json @@ -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" + } +} \ No newline at end of file diff --git a/tuts/008-vpc-private-servers-gs/javascript/scenarios/getting-started.js b/tuts/008-vpc-private-servers-gs/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..8e21af3 --- /dev/null +++ b/tuts/008-vpc-private-servers-gs/javascript/scenarios/getting-started.js @@ -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(); diff --git a/tuts/008-vpc-private-servers-gs/javascript/tests/ec2.test.js b/tuts/008-vpc-private-servers-gs/javascript/tests/ec2.test.js new file mode 100644 index 0000000..2b378c5 --- /dev/null +++ b/tuts/008-vpc-private-servers-gs/javascript/tests/ec2.test.js @@ -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); + }); +}); diff --git a/tuts/009-vpc-ipam-gs/javascript/libs/ec2-wrapper.js b/tuts/009-vpc-ipam-gs/javascript/libs/ec2-wrapper.js new file mode 100644 index 0000000..274caff --- /dev/null +++ b/tuts/009-vpc-ipam-gs/javascript/libs/ec2-wrapper.js @@ -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 diff --git a/tuts/009-vpc-ipam-gs/javascript/package.json b/tuts/009-vpc-ipam-gs/javascript/package.json new file mode 100644 index 0000000..e792181 --- /dev/null +++ b/tuts/009-vpc-ipam-gs/javascript/package.json @@ -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" + } +} \ No newline at end of file diff --git a/tuts/009-vpc-ipam-gs/javascript/scenarios/getting-started.js b/tuts/009-vpc-ipam-gs/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..8e21af3 --- /dev/null +++ b/tuts/009-vpc-ipam-gs/javascript/scenarios/getting-started.js @@ -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(); diff --git a/tuts/009-vpc-ipam-gs/javascript/tests/ec2.test.js b/tuts/009-vpc-ipam-gs/javascript/tests/ec2.test.js new file mode 100644 index 0000000..2b378c5 --- /dev/null +++ b/tuts/009-vpc-ipam-gs/javascript/tests/ec2.test.js @@ -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); + }); +}); diff --git a/tuts/010-cloudmap-service-discovery/javascript/libs/servicediscovery-wrapper.js b/tuts/010-cloudmap-service-discovery/javascript/libs/servicediscovery-wrapper.js new file mode 100644 index 0000000..9acbc44 --- /dev/null +++ b/tuts/010-cloudmap-service-discovery/javascript/libs/servicediscovery-wrapper.js @@ -0,0 +1,21 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { ServiceDiscoveryClient, CreatePublicDnsNamespaceCommand, CreateServiceCommand, DeleteNamespaceCommand, DeleteServiceCommand } from "@aws-sdk/client-servicediscovery"; + +export const createNamespace = async (client, params) => { + const command = new CreatePublicDnsNamespaceCommand(params); + return client.send(command); +}; +export const createService = async (client, params) => { + const command = new CreateServiceCommand(params); + return client.send(command); +}; +export const deleteService = async (client, params) => { + const command = new DeleteServiceCommand(params); + return client.send(command); +}; +export const deleteNamespace = async (client, params) => { + const command = new DeleteNamespaceCommand(params); + return client.send(command); +}; diff --git a/tuts/010-cloudmap-service-discovery/javascript/package.json b/tuts/010-cloudmap-service-discovery/javascript/package.json new file mode 100644 index 0000000..a1c9902 --- /dev/null +++ b/tuts/010-cloudmap-service-discovery/javascript/package.json @@ -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" + } +} \ No newline at end of file diff --git a/tuts/010-cloudmap-service-discovery/javascript/scenarios/getting-started.js b/tuts/010-cloudmap-service-discovery/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..6523c5d --- /dev/null +++ b/tuts/010-cloudmap-service-discovery/javascript/scenarios/getting-started.js @@ -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(); diff --git a/tuts/010-cloudmap-service-discovery/javascript/tests/servicediscovery.test.js b/tuts/010-cloudmap-service-discovery/javascript/tests/servicediscovery.test.js new file mode 100644 index 0000000..4273bc1 --- /dev/null +++ b/tuts/010-cloudmap-service-discovery/javascript/tests/servicediscovery.test.js @@ -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); + }); +}); diff --git a/tuts/011-getting-started-batch-fargate/javascript/libs/batch-wrapper.js b/tuts/011-getting-started-batch-fargate/javascript/libs/batch-wrapper.js new file mode 100644 index 0000000..1ea670a --- /dev/null +++ b/tuts/011-getting-started-batch-fargate/javascript/libs/batch-wrapper.js @@ -0,0 +1,21 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { BatchClient, CreateComputeEnvironmentCommand, CreateJobQueueCommand, DeleteComputeEnvironmentCommand, DeleteJobQueueCommand } from "@aws-sdk/client-batch"; + +export const createComputeEnv = async (client, params) => { + const command = new CreateComputeEnvironmentCommand(params); + return client.send(command); +}; +export const createJobQueue = async (client, params) => { + const command = new CreateJobQueueCommand(params); + return client.send(command); +}; +export const deleteJobQueue = async (client, params) => { + const command = new DeleteJobQueueCommand(params); + return client.send(command); +}; +export const deleteComputeEnv = async (client, params) => { + const command = new DeleteComputeEnvironmentCommand(params); + return client.send(command); +}; diff --git a/tuts/011-getting-started-batch-fargate/javascript/package.json b/tuts/011-getting-started-batch-fargate/javascript/package.json new file mode 100644 index 0000000..b9845f8 --- /dev/null +++ b/tuts/011-getting-started-batch-fargate/javascript/package.json @@ -0,0 +1,14 @@ +{ + "name": "tutorial-batch", + "type": "module", + "scripts": { + "test": "vitest run" + }, + "dependencies": { + "@aws-sdk/client-batch": "latest" + }, + "devDependencies": { + "vitest": "latest", + "aws-sdk-client-mock": "latest" + } +} \ No newline at end of file diff --git a/tuts/011-getting-started-batch-fargate/javascript/scenarios/getting-started.js b/tuts/011-getting-started-batch-fargate/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..b7eb98f --- /dev/null +++ b/tuts/011-getting-started-batch-fargate/javascript/scenarios/getting-started.js @@ -0,0 +1,15 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { BatchClient } from "@aws-sdk/client-batch"; +import { randomUUID } from "crypto"; + +const main = async () => { + const client = new BatchClient({}); + const suffix = randomUUID().slice(0, 8); + console.log("Running batch getting started scenario..."); + // TODO: implement setup, interact, teardown + console.log("Scenario complete."); +}; + +main(); diff --git a/tuts/011-getting-started-batch-fargate/javascript/tests/batch.test.js b/tuts/011-getting-started-batch-fargate/javascript/tests/batch.test.js new file mode 100644 index 0000000..df55b48 --- /dev/null +++ b/tuts/011-getting-started-batch-fargate/javascript/tests/batch.test.js @@ -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 { BatchClient } from "@aws-sdk/client-batch"; + +const mock = mockClient(BatchClient); + +describe("batch wrapper", () => { + beforeEach(() => mock.reset()); + + it("placeholder test", () => { + expect(true).toBe(true); + }); +}); diff --git a/tuts/012-transitgateway-gettingstarted/javascript/libs/ec2-wrapper.js b/tuts/012-transitgateway-gettingstarted/javascript/libs/ec2-wrapper.js new file mode 100644 index 0000000..274caff --- /dev/null +++ b/tuts/012-transitgateway-gettingstarted/javascript/libs/ec2-wrapper.js @@ -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 diff --git a/tuts/012-transitgateway-gettingstarted/javascript/package.json b/tuts/012-transitgateway-gettingstarted/javascript/package.json new file mode 100644 index 0000000..e792181 --- /dev/null +++ b/tuts/012-transitgateway-gettingstarted/javascript/package.json @@ -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" + } +} \ No newline at end of file diff --git a/tuts/012-transitgateway-gettingstarted/javascript/scenarios/getting-started.js b/tuts/012-transitgateway-gettingstarted/javascript/scenarios/getting-started.js new file mode 100644 index 0000000..8e21af3 --- /dev/null +++ b/tuts/012-transitgateway-gettingstarted/javascript/scenarios/getting-started.js @@ -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(); diff --git a/tuts/012-transitgateway-gettingstarted/javascript/tests/ec2.test.js b/tuts/012-transitgateway-gettingstarted/javascript/tests/ec2.test.js new file mode 100644 index 0000000..2b378c5 --- /dev/null +++ b/tuts/012-transitgateway-gettingstarted/javascript/tests/ec2.test.js @@ -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); + }); +});