Skip to content

Commit

Permalink
fix(examples): prefix resources with 'example' to peg test run artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
metral committed May 17, 2019
1 parent 758431c commit 4e35503
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion nodejs/eks/examples/cluster/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: cluster
name: example-cluster
description: EKS cluster example
runtime: nodejs
6 changes: 3 additions & 3 deletions nodejs/eks/examples/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import * as awsx from "@pulumi/awsx";
import * as eks from "@pulumi/eks";

// Create an EKS cluster with the default configuration.
const cluster1 = new eks.Cluster("cluster1");
const cluster1 = new eks.Cluster("example-cluster1");

// Create an EKS cluster with non-default configuration
const vpc = new awsx.Network("vpc", { usePrivateSubnets: true });
const cluster2 = new eks.Cluster("cluster2", {
const vpc = new awsx.Network("example-cluster2-vpc", { usePrivateSubnets: true });
const cluster2 = new eks.Cluster("example-cluster2", {
vpcId: vpc.vpcId,
subnetIds: vpc.subnetIds,
desiredCapacity: 2,
Expand Down
2 changes: 1 addition & 1 deletion nodejs/eks/examples/cluster/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "cluster",
"name": "example-cluster",
"devDependencies": {
"typescript": "^2.7.2",
"@types/node": "latest"
Expand Down
2 changes: 1 addition & 1 deletion nodejs/eks/examples/nodegroup/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: nodegroup
name: example-nodegroup
description: EKS nodegroup with IAM examples
runtime: nodejs
34 changes: 17 additions & 17 deletions nodejs/eks/examples/nodegroup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import * as iam from "./iam";
// - "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"
// - "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"
// - "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
const role0 = iam.createRole("myrole0");
const instanceProfile0 = new aws.iam.InstanceProfile("myInstanceProfile0", {role: role0});
const role0 = iam.createRole("example-role0");
const instanceProfile0 = new aws.iam.InstanceProfile("example-instanceProfile0", {role: role0});

// Create an EKS cluster with a shared IAM instance role to register with the
// cluster auth.
const cluster1 = new eks.Cluster("nodegroup-iam-simple", {
const cluster1 = new eks.Cluster("example-nodegroup-iam-simple", {
skipDefaultNodeGroup: true,
deployDashboard: false,
instanceRole: role0,
Expand All @@ -30,19 +30,19 @@ const cluster1 = new eks.Cluster("nodegroup-iam-simple", {

// Create the node group using an `instanceProfile` tied to the shared, cluster
// instance role registered with the cluster auth through `instanceRole`.
cluster1.createNodeGroup("ng-simple-ondemand", {
instanceType: "t2.large",
cluster1.createNodeGroup("example-ng-simple-ondemand", {
instanceType: "t2.medium",
desiredCapacity: 1,
minSize: 1,
maxSize: 2,
labels: {"ondemand": "true"},
instanceProfile: instanceProfile0,
});

// Create the second node group with spot m4.large instance
const spot = new eks.NodeGroup("ng-simple-spot", {
// Create the second node group with spot t2.medium instance
const spot = new eks.NodeGroup("example-ng-simple-spot", {
cluster: cluster1,
instanceType: "m4.large",
instanceType: "t2.medium",
desiredCapacity: 1,
minSize: 1,
maxSize: 2,
Expand All @@ -67,32 +67,32 @@ export const kubeconfig1 = cluster1.kubeconfig;
* role and profile.
*/

const role1 = iam.createRole("myrole1");
const role2 = iam.createRole("myrole2");
const instanceProfile1 = new aws.iam.InstanceProfile("myInstanceProfile1", {role: role1});
const instanceProfile2 = new aws.iam.InstanceProfile("myInstanceProfile2", {role: role2});
const role1 = iam.createRole("example-role1");
const role2 = iam.createRole("example-role2");
const instanceProfile1 = new aws.iam.InstanceProfile("example-instanceProfile1", {role: role1});
const instanceProfile2 = new aws.iam.InstanceProfile("example-instanceProfile2", {role: role2});

// Create an EKS cluster with many IAM roles to register with the cluster auth.
const cluster2 = new eks.Cluster("nodegroup-iam-advanced", {
const cluster2 = new eks.Cluster("example-nodegroup-iam-advanced", {
skipDefaultNodeGroup: true,
deployDashboard: false,
instanceRoles: [role1, role2],
});

// Create node groups using a different `instanceProfile` tied to one of the many
// instance roles registered with the cluster auth through `instanceRoles`.
cluster2.createNodeGroup("ng-advanced-ondemand", {
instanceType: "t2.large",
cluster2.createNodeGroup("example-ng-advanced-ondemand", {
instanceType: "t2.medium",
desiredCapacity: 1,
minSize: 1,
maxSize: 2,
labels: {"ondemand": "true"},
instanceProfile: instanceProfile1,
});

const spot2 = new eks.NodeGroup("ng-advanced-spot", {
const spot2 = new eks.NodeGroup("example-ng-advanced-spot", {
cluster: cluster2,
instanceType: "m4.large",
instanceType: "t2.medium",
desiredCapacity: 1,
spotPrice: "1",
minSize: 1,
Expand Down
2 changes: 1 addition & 1 deletion nodejs/eks/examples/nodegroup/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nodegroup",
"name": "example-nodegroup",
"devDependencies": {
"typescript": "^3.0.0",
"@types/node": "latest"
Expand Down
2 changes: 1 addition & 1 deletion nodejs/eks/examples/private-cluster/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: private-cluster
name: example-private-subnets-cluster
description: EKS cluster example in private subnets.
runtime: nodejs
2 changes: 1 addition & 1 deletion nodejs/eks/examples/private-cluster/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as awsx from "@pulumi/awsx";
import * as eks from "@pulumi/eks";

const name = "private-cluster";
const name = "example-private-subnets-cluster";

// Create a VPC that uses private subnets.
const network = new awsx.Network(name, {
Expand Down
2 changes: 1 addition & 1 deletion nodejs/eks/examples/private-cluster/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "private-cluster",
"name": "example-private-subnets-cluster",
"dependencies": {
"typescript": "^2.7.2",
"@types/node": "latest",
Expand Down
4 changes: 2 additions & 2 deletions nodejs/eks/examples/tags/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: tags
description: EKS cluster and nodegroups with various types of AWS resource tagging
name: example-tags
description: EKS cluster and nodegroups example with various types of AWS resource tagging
runtime: nodejs
12 changes: 6 additions & 6 deletions nodejs/eks/examples/tags/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as eks from "@pulumi/eks";
import * as iam from "./iam";

// Create an EKS cluster with cluster and resource tags.
const cluster1 = new eks.Cluster("tags-cluster1", {
const cluster1 = new eks.Cluster("example-tags-cluster1", {
instanceType: "t2.medium",
desiredCapacity: 1,
minSize: 1,
Expand All @@ -21,9 +21,9 @@ const cluster1 = new eks.Cluster("tags-cluster1", {
export const kubeconfig1 = cluster1.kubeconfig;

// Create an EKS cluster with no default node group.
const role0 = iam.createRole("tags-myrole0");
const instanceProfile0 = new aws.iam.InstanceProfile("tags-myInstanceProfile0", {role: role0});
const cluster2 = new eks.Cluster("tags-cluster2", {
const role0 = iam.createRole("example-tags-role0");
const instanceProfile0 = new aws.iam.InstanceProfile("example-tags-instanceProfile0", {role: role0});
const cluster2 = new eks.Cluster("example-tags-cluster2", {
skipDefaultNodeGroup: true,
deployDashboard: false,
instanceRole: role0,
Expand All @@ -40,7 +40,7 @@ const cluster2 = new eks.Cluster("tags-cluster2", {
// 2. A `NodeGroup` resource which accepts an `eks.Cluster` as input

// Create the node group using an on-demand instance and resource tags.
cluster2.createNodeGroup("ng-tags-ondemand", {
cluster2.createNodeGroup("example-ng-tags-ondemand", {
instanceType: "t2.medium",
desiredCapacity: 1,
minSize: 1,
Expand All @@ -52,7 +52,7 @@ cluster2.createNodeGroup("ng-tags-ondemand", {
});

// Create the second node group using a spot price instance and resource tags.
const spot = new eks.NodeGroup("ng-tags-spot", {
const spot = new eks.NodeGroup("example-ng-tags-spot", {
cluster: cluster2,
instanceType: "t2.medium",
desiredCapacity: 1,
Expand Down
2 changes: 1 addition & 1 deletion nodejs/eks/examples/tags/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nodegroup",
"name": "example-tags",
"devDependencies": {
"typescript": "^3.0.0",
"@types/node": "latest"
Expand Down

0 comments on commit 4e35503

Please sign in to comment.