New issue
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
Attribute must be a whole number
Issue
#1940
Comments
I believe the code related to the creation of this issue is Python and the error is firing for a port property on a targetgroup resource. There is another instance of this issue that is being seen by a different customer.
I have tried to reproduce unsuccessfully. |
We ran into the same. After reverting from
back to
then it went through |
@dennispan or others hitting this issue, can you provide any other details. For example:
|
Seems most likely triggered by That brought in this diff of dependencies: pulumi/pulumi-aws@v6.32.0...v6.33.1#diff-0301265a2d4321ca487bbd7ba523f69633171cef680c0114e7ca8d2c34176b73. And most importantly:
|
Quite possibly caused by #1896, which was part of pulumi-terraform-bridge/v3@v3.81.0. |
We believe we've heard reports against these providers - though it may also impact others:
|
@lukehoban we ran into this in 2 consecutive Here's the logs from
|
repro: import * as aws from "@pulumi/aws";
const vpc = new aws.ec2.Vpc("main", { cidrBlock: "10.0.0.0/16" });
const subnet = new aws.ec2.Subnet("main", {
vpcId: vpc.id,
cidrBlock: "10.0.12.0/24",
availabilityZone: "us-east-1a"
});
const subnet2 = new aws.ec2.Subnet("subnet2", {
vpcId: vpc.id,
cidrBlock: "10.0.5.0/24",
availabilityZone: "us-east-1b"
});
const secGroup = new aws.ec2.SecurityGroup("allowTls", {
description: "Allow TLS inbound traffic and all outbound traffic",
vpcId: vpc.id,
tags: {
Name: "allow_tls",
},
});
const loadbalancer = new aws.lb.LoadBalancer("payload-lb", {
loadBalancerType: "application",
securityGroups: [secGroup.id],
subnets: [subnet.id, subnet2.id],
internal: true,
});
const targetGroup = new aws.lb.TargetGroup("payload-tg", {
port: 80,
protocol: "HTTP",
targetType: "ip",
vpcId: vpc.id,
});
const ubuntu = aws.ec2.getAmi({
mostRecent: true,
filters: [
{
name: "name",
values: ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"],
},
{
name: "virtualization-type",
values: ["hvm"],
},
],
owners: ["099720109477"],
});
const web = new aws.ec2.Instance("web", {
ami: ubuntu.then(ubuntu => ubuntu.id),
instanceType: aws.ec2.InstanceType.T3_Micro,
tags: {
Name: "HelloWorld",
},
});
const attachment = new aws.lb.TargetGroupAttachment("payload-tga", {
targetGroupArn: targetGroup.arn,
// @ts-ignore
port: "80",
targetId: web.id,
});
export const vpcId = vpc.id;
export const subnet1Id = subnet.id
export const subnet2Id = subnet2.id
export const loadBalancerARN = loadbalancer.arn
export const targetGroupARN = targetGroup.arn This suggests that affected users should be able to work around the issue with some explicit type casting in python and typescript. EDIT: here's a simpler repro: import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ubuntu = aws.ec2.getAmi({
mostRecent: true,
filters: [
{
name: "name",
values: ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"],
},
{
name: "virtualization-type",
values: ["hvm"],
},
],
owners: ["099720109477"],
});
const web = new aws.ec2.Instance("web", {
ami: ubuntu.then(ubuntu => ubuntu.id),
instanceType: aws.ec2.InstanceType.T3_Micro,
// @ts-ignore
cpuCoreCount: "2"
}); The issue is triggered by forcing a string into an int input. Seems like we previously silently accepted that and did the conversion somewhere but we no longer do the conversion and now TF raises an error. I strongly suspect this affects all bridged providers. I believe the issue in the original PR which introduced it is here: https://github.com/pulumi/pulumi-terraform-bridge/pull/1945/files#diff-5f10eecfa13490de36f3e3e71c19a2233316ebe835e2971f9a3e7d83e3b20250R434 We seem to return an int64 from |
This is a quick fix to address customer issues outlined in pulumi/pulumi-terraform-bridge#1940. While we develop a more complete fix for the above issue, this will unblock customers and enable them to upgrade.
This is a quick fix to address customer issues outlined in pulumi/pulumi-terraform-bridge#1940. The [bridge version used](https://github.com/pulumi/pulumi-terraform-bridge/tree/revert-1896-for-gcp) is based off of the last pinned bridge commit, with pulumi/pulumi-terraform-bridge#1896 reverted. While we develop a more complete fix for the above issue, this will unblock customers and enable them to upgrade.
This is a quick fix to address customer issues outlined in pulumi/pulumi-terraform-bridge#1940. While we develop a more complete fix for the above issue, this will unblock customers and enable them to upgrade. --------- Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
This adds a program which uses a string for an int property. This reproduces the issue seen in pulumi/pulumi-terraform-bridge#1940
Fixes #1940 The tf-plugin-sdk type checks input to int fields and only allows explicit ints and strings, not int64 and similar: https://github.com/hashicorp/terraform-plugin-sdk/blob/1f499688ebd9420768f501d4ed622a51b2135ced/helper/schema/schema.go#L2269 This corrects the type there and adds tests for implicitly converting all primitive types.
Customer is receiving an
Attribute must be a whole number, got 80. Examine values at XXXX
despite the value being a whole number and the code not changing.It has been recommended that a ticket should be open ticket as multiple users are seeing this.
The text was updated successfully, but these errors were encountered: