Skip to content

Commit

Permalink
Ensuring that any calls to aws.getAmi are now aws.ec2.getAmi (pulumi#928
Browse files Browse the repository at this point in the history
)
  • Loading branch information
stack72 committed Mar 4, 2021
1 parent 8396323 commit 978d32b
Show file tree
Hide file tree
Showing 21 changed files with 172 additions and 59 deletions.
4 changes: 2 additions & 2 deletions aws-cs-webserver/WebServerStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class WebServerStack : Stack
{
public WebServerStack()
{
var ami = Output.Create(GetAmi.InvokeAsync(new GetAmiArgs
var ami = Output.Create(Pulumi.Aws.Ec2.GetAmi.InvokeAsync(new Pulumi.Aws.Ec2.GetAmiArgs
{
MostRecent = true,
Owners = {"137112412989"},
Filters = {new GetAmiFilterArgs {Name = "name", Values = {"amzn-ami-hvm-*"}}}
Filters = {new Pulumi.Aws.Ec2.Inputs.GetAmiFilterArgs {Name = "name", Values = {"amzn-ami-hvm-*"}}}
}));

var group = new SecurityGroup("web-secgrp", new SecurityGroupArgs
Expand Down
4 changes: 2 additions & 2 deletions aws-go-webserver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/pulumi/examples/aws-go-webserver
go 1.13

require (
github.com/pulumi/pulumi-aws/sdk/v3 v3.1.0
github.com/pulumi/pulumi/sdk/v2 v2.5.0
github.com/pulumi/pulumi-aws/sdk/v3 v3.31.0
github.com/pulumi/pulumi/sdk/v2 v2.22.0
)
86 changes: 71 additions & 15 deletions aws-go-webserver/go.sum

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions aws-go-webserver/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
Expand All @@ -25,8 +24,8 @@ func main() {

// Get the ID for the latest Amazon Linux AMI.
mostRecent := true
ami, err := aws.GetAmi(ctx, &aws.GetAmiArgs{
Filters: []aws.GetAmiFilter{
ami, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{
Filters: []ec2.GetAmiFilter{
{
Name: "name",
Values: []string{"amzn-ami-hvm-*-x86_64-ebs"},
Expand Down
2 changes: 1 addition & 1 deletion aws-js-webserver-component/webserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");

// Get the id for the latest Amazon Linux AMI
let ami = aws.getAmi({
let ami = aws.ec2.getAmi({
filters: [
{ name: "name", values: ["amzn-ami-hvm-*-x86_64-ebs"] },
],
Expand Down
2 changes: 1 addition & 1 deletion aws-js-webserver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const aws = require("@pulumi/aws");
let size = "t2.micro"; // t2.micro is available in the AWS free tier

// Get the id for the latest Amazon Linux AMI
let ami = aws.getAmi({
let ami = aws.ec2.getAmi({
filters: [
{ name: "name", values: ["amzn-ami-hvm-*-x86_64-ebs"] },
],
Expand Down
4 changes: 2 additions & 2 deletions aws-py-ec2-provisioners/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def decode_key(key):
)

# Get the AMI
ami = aws.get_ami(
ami = aws.ec2.get_ami(
owners=['amazon'],
most_recent=True,
filters=[aws.GetAmiFilterArgs(
filters=[aws.ec2.GetAmiFilterArgs(
name='name',
values=['amzn2-ami-hvm-2.0.????????-x86_64-gp2'],
)],
Expand Down
2 changes: 1 addition & 1 deletion aws-ts-ec2-provisioners/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const secgrp = new aws.ec2.SecurityGroup("secgrp", {
});

// Get the AMI
const amiId = aws.getAmi({
const amiId = aws.ec2.getAmi({
owners: ["amazon"],
mostRecent: true,
filters: [{
Expand Down
2 changes: 1 addition & 1 deletion aws-ts-ruby-on-rails/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const webSg = new aws.ec2.SecurityGroup("webServerSecurityGroup", {
],
});

const amiId = aws.getAmi({
const amiId = aws.ec2.getAmi({
filters: [
{
name: "name",
Expand Down
2 changes: 1 addition & 1 deletion aws-ts-stackreference/team/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const combinedTags = {
"Managed By": "Pulumi",
};

const amiId = aws.getAmi({
const amiId = aws.ec2.getAmi({
owners: ["099720109477"], // Ubuntu
mostRecent: true,
filters: [
Expand Down
2 changes: 1 addition & 1 deletion f5bigip-ts-ltm-pool/f5bigip-ec2-instance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const firewall = new aws.ec2.SecurityGroup("bigIp", {
--filters "Name=product-code,Values=8esk90vx7v713sa0muq2skw3j" \
--filters "Name=name,Values='F5 Networks BIGIP-14.0.0.1-0.0.2 PAYG - Good 25Mbps *'"
*/
const bigIpAmiId = aws.getAmi({
const bigIpAmiId = aws.ec2.getAmi({
mostRecent: true,
owners: ["679593333241"],
filters: [
Expand Down
2 changes: 1 addition & 1 deletion f5bigip-ts-ltm-pool/nginx-ec2-instance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const baseTags = {
project: `${pulumi.getProject()}-${pulumi.getStack()}`,
};

const ubuntuAmiId = aws.getAmi({
const ubuntuAmiId = aws.ec2.getAmi({
mostRecent: true,
nameRegex: "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*",
owners: ["099720109477"],
Expand Down
4 changes: 2 additions & 2 deletions testing-unit-cs/WebserverStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public WebserverStack()
}
});

var amiId = Output.Create(GetAmi.InvokeAsync(new GetAmiArgs
var amiId = Output.Create(Pulumi.Aws.Ec2.GetAmi.InvokeAsync(new Pulumi.Aws.Ec2.GetAmiArgs
{
MostRecent = true,
Owners = {"099720109477"},
Filters = {
new GetAmiFilterArgs
new Pulumi.Aws.Ec2.Inputs.GetAmiFilterArgs
{
Name = "name",
Values = {"ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*"},
Expand Down
6 changes: 3 additions & 3 deletions testing-unit-go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/pulumi/examples/testing-unit-go
go 1.13

require (
github.com/pulumi/pulumi-aws/sdk/v3 v3.1.0
github.com/pulumi/pulumi/sdk/v2 v2.2.1
github.com/stretchr/testify v1.5.1
github.com/pulumi/pulumi-aws/sdk/v3 v3.31.0
github.com/pulumi/pulumi/sdk/v2 v2.22.0
github.com/stretchr/testify v1.6.1
)
Loading

0 comments on commit 978d32b

Please sign in to comment.