better-shampoo-48884
04/10/2021, 11:13 AMbetter-shampoo-48884
04/10/2021, 11:14 AMvictorious-vegetable-49526
04/11/2021, 10:42 AMqueue.onEvent()
, so i have to somehow reference the SQS resource.
And here is where things get confused to me. If i get
the queue, i cannot manage it. If i import the queue, them i can manage it and it works ok. But is this really the best approach?victorious-vegetable-49526
04/11/2021, 10:58 AMpolite-napkin-90098
04/12/2021, 7:34 PMalert-mouse-36715
04/13/2021, 9:56 AMpolite-napkin-90098
04/13/2021, 4:10 PMgifted-controller-71470
04/14/2021, 1:58 AMpolite-napkin-90098
04/14/2021, 7:09 PMprivateSg.Id undefined (type *ec2.SecurityGroup has no field or method Id)
I feel there's something really simple I'm missing here.quiet-monkey-16826
04/15/2021, 4:06 AMtall-yacht-63106
04/15/2021, 1:54 PMlate-diamond-14259
04/15/2021, 8:35 PMadamant-wire-24627
04/16/2021, 12:06 AMtf2pulumi
command. It complained that error: no resource plugin 'testProvider' found in the workspace or on your $PATH
. I am wondering that is there any document about how to fix this? Thanks!creamy-jelly-56953
04/19/2021, 12:39 PMcreamy-jelly-56953
04/19/2021, 12:41 PMlet ip = await kq
.list("v1", "Service", "istio-system")
.filter(it => it.status?.loadBalancer?.ingress?.length > 0)
.map(it => it.status?.loadBalancer?.ingress)
.firstOrDefault([]).then(it => (it?.length) ? it[0].ip : undefined).then((val) => {
return val
});
But I’m not sure how to wrap this into a Custom (dynamic?) resource to be able to have other resources depend on that (like, creating an AWS Route53 A record pointing to the newly created IP)creamy-jelly-56953
04/19/2021, 12:42 PMcreamy-jelly-56953
04/19/2021, 12:43 PMbetter-shampoo-48884
04/20/2021, 7:12 AMpolite-napkin-90098
04/20/2021, 4:05 PMhandsome-napkin-75099
04/20/2021, 4:15 PMimport * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
// Step 1: Define the Networking for our service. Will join the appropriate POD network. Pod02 or Pod03.
// Use an existing VPC, subnets, and gateways.
const existingVpc = awsx.ec2.Vpc.fromExistingIds("existingVpc", {
vpcId: "vpc-xxxxxxxxxxxxxx",
publicSubnetIds: ["subnet-1111111111111111", "subnet-22222222222222222", "subnet-3333333333333333"],
//privateSubnetIds: ["subnet-22222222222222222", "subnet-33333333333333333"],
internetGatewayId: "igw-xxxxxxxxxxxxxxxx",
//natGatewayIds: ["nat-00000000000000000", "nat-11111111111111111"],
})
// Step 2: Create an ECS EC2 cluster.
const cluster = new awsx.ecs.Cluster("EBS-to-EFS", {
vpc: existingVpc,
tags: {
"Name": "EBS-to-EFS-cluster",
},
});
export const userData =
`#!/bin/bash`
// Comment out the following lines of the userData script till I get userData to not crash the stack.
// yum install -y amazon-efs-utils
// yum install -y nfs-utils
// yum install -y aws-cfn-bootstrap
// /opt/aws/bin/cfn-init -v --region \${AWS::Region} --stack \${AWS::StackName} --resource ContainerInstances
// /opt/aws/bin/cfn-signal -e \$? --region \${AWS::Region} --stack \${AWS::StackName} --resource ECSAutoScalingGroup
// #open file descriptor for stderr
// exec 2>>/var/log/ecs/ecs-agent-install.log
// set -x
// #verify that the agent is running
// until curl -s <http://localhost:51678/v1/metadata>
// do
// sleep 1
// done
// #install the Docker volume plugin
// docker plugin install rexray/efs REXRAY_PREEMPT=true EFS_REGION=\${AWS::Region} EFS_SECURITYGROUPS=\${EFSSecurityGroup} --grant-all-permissions
// docker plugin install rexray/ebs REXRAY_PREEMPT=true EBS_REGION=\${AWS::Region} --grant-all-permissions
// #restart the ECS agent
// stop ecs
// start ecs`
const asg = cluster.createAutoScalingGroup("asg", {
templateParameters: { minSize: 1 },
subnetIds: existingVpc.publicSubnetIds,
launchConfigurationArgs: {
instanceType: "t2.medium",
associatePublicIpAddress: true,
userData: userData,
},
});
const nginx = new awsx.ecs.EC2Service("nginx", {
cluster,
taskDefinitionArgs: {
containers: {
nginx: {
image: "nginx",
memory: 128,
networkListener: { port: 80},
},
},
},
desiredCount: 2,
});
// Export interesting fields to make them easy to use:
export const vpcId = existingVpc.id;
//export const vpcPrivateSubnetIds = existingVpc.privateSubnetIds;
export const vpcPublicSubnetIds = existingVpc.publicSubnetIds;
If I comment out userData: userData in the Autoscaling Group Definition I have a successful build. When I uncomment the line a include userData in the Autoscaling group the stack errors out with the following.
Diagnostics:
aws:cloudformation:Stack (asg):
error: 1 error occurred:
* creating urn:pulumi:dev::ecs-cpass::awsx:x:ecs:Cluster$awsx:x:autoscaling:AutoScalingGroup$aws:cloudformation/stack:Stack::asg: 1 error occurred:
* error waiting for CloudFormation Stack creation: failed to create CloudFormation stack, rollback requested (ROLLBACK_COMPLETE): ["The following resource(s) failed to create: [Instances]. Rollback requested by user." "Received 0 SUCCESS signal(s) out of 1. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement"]
pulumi:pulumi:Stack (ecs-cpass-dev):
error: update failed
Any hints or code examples that I could follow to get this functioning properly? I have spent way to many hours trying to diagnose how to fix this.straight-scientist-39468
04/20/2021, 6:08 PMcool-policeman-37867
04/21/2021, 2:28 AMgifted-planet-80560
04/21/2021, 8:49 PMimport pulumi
import pulumi_aws as aws
size = 't2.micro'
ami = aws.get_ami(most_recent="true",
owners=["137112412989"],
filters=[{"name":"name","values":["amzn-ami-hvm-*"]}])
group = aws.ec2.SecurityGroup('webserver-secgrp',
description='Enable HTTP access',
ingress=[
{ 'protocol': 'tcp', 'from_port': 22, 'to_port': 22, 'cidr_blocks': ['0.0.0.0/0'] }
])
server = aws.ec2.Instance('webserver-www',
instance_type=size,
vpc_security_group_ids=[group.id], # reference security group from above
ami=ami.id)
pulumi.export('publicIp', server.public_ip)
pulumi.export('publicHostName', server.public_dns)
Is there a list of such aliases for AMIs "amzn-ami-hvm-*"? If I want to use Ubuntu Server 20.04 LTS (HVM) instead of Amazon Linux 2 AMI (HVM).shy-sandwich-50117
04/22/2021, 10:24 PMpurple-cpu-63961
04/23/2021, 4:08 PMshy-sandwich-50117
04/23/2021, 4:20 PMshy-sandwich-50117
04/23/2021, 4:21 PMshy-sandwich-50117
04/26/2021, 3:30 PMalert-gpu-24581
04/27/2021, 5:25 PMalert-gpu-24581
04/27/2021, 5:26 PM