We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Copilot REST API docs say that content is a string.
content
string
In the case of code, it is not, however. For example, I am seeing an object:
{ "role": "assistant", "kind": "program", "content": { "code": "name: aws-ec2-python-webserver\nruntime: yaml\nvariables:\n amazonLinuxAmi:\n fn::invoke:\n function: aws:ec2:getAmi\n arguments:\n filters:\n - name: name\n values: [\"amzn2-ami-hvm-*-x86_64-gp2\"]\n owners: [\"137112412989\"]\n mostRecent: true\nresources:\n webServerSecurityGroup:\n type: aws:ec2:SecurityGroup\n properties:\n description: Enable HTTP access\n ingress:\n - protocol: tcp\n fromPort: 80\n toPort: 80\n cidrBlocks: [\"0.0.0.0/0\"]\n egress:\n - protocol: -1\n fromPort: 0\n toPort: 0\n cidrBlocks: [\"0.0.0.0/0\"]\n webServerRole:\n type: aws:iam:Role\n properties:\n assumeRolePolicy: |\n {\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Action\": \"sts:AssumeRole\",\n \"Principal\": {\n \"Service\": \"ec2.amazonaws.com\"\n },\n \"Effect\": \"Allow\",\n \"Sid\": \"\"\n }\n ]\n }\n webServerRolePolicy:\n type: aws:iam:RolePolicy\n properties:\n role: ${webServerRole.name}\n policy: |\n {\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": \"ec2:Describe*\",\n \"Resource\": \"*\"\n }\n ]\n }\n webServerInstance:\n type: aws:ec2:Instance\n properties:\n ami: ${amazonLinuxAmi.id}\n instanceType: t2.micro\n securityGroups: [${webServerSecurityGroup.name}]\n iamInstanceProfile: ${webServerRole.name}\n userData: |\n #!/bin/bash\n yum update -y\n yum install -y python3\n echo \"from http.server import SimpleHTTPRequestHandler, HTTPServer\" > /home/ec2-user/webserver.py\n echo \"class Handler(SimpleHTTPRequestHandler):\" >> /home/ec2-user/webserver.py\n echo \" def do_GET(self):\" >> /home/ec2-user/webserver.py\n echo \" self.send_response(200)\" >> /home/ec2-user/webserver.py\n echo \" self.send_header('Content-type', 'text/html')\" >> /home/ec2-user/webserver.py\n echo \" self.end_headers()\" >> /home/ec2-user/webserver.py\n echo \" self.wfile.write(b'Hello, World')\" >> /home/ec2-user/webserver.py\n echo \"httpd = HTTPServer(('0.0.0.0', 80), Handler)\" >> /home/ec2-user/webserver.py\n echo \"httpd.serve_forever()\" >> /home/ec2-user/webserver.py\n python3 /home/ec2-user/webserver.py\noutputs:\n instancePublicIp: ${webServerInstance.publicIp}", "language": "YAML", "plan": { "instructions": "Create a Pulumi YAML program to deploy a small AWS EC2 server running the latest Amazon Linux 2 AMI. The server should run a simple Python webserver accessible over the Internet that responds with 'Hello, World.'", "searchTerms": [ "AWS EC2 instance", "Amazon Linux 2 AMI", "Python webserver", "Pulumi YAML", "security group", "IAM role", "user data script" ] }, "programMetadata": { "programId": "", "validationStatus": "unknown" } } }
Totally makes sense why, but we should clarify this in the docs.
The text was updated successfully, but these errors were encountered:
Will fix this sprint.
Sorry, something went wrong.
arturl
No branches or pull requests
The Copilot REST API docs say that
content
is astring
.In the case of code, it is not, however. For example, I am seeing an object:
Totally makes sense why, but we should clarify this in the docs.
The text was updated successfully, but these errors were encountered: