https://pulumi.com logo
#typescript
Title
# typescript
a

astonishing-tiger-81216

08/26/2021, 1:06 PM
Hi, having trouble implementing this interface to specify a security group id as the source.
Copy code
export interface SecurityGroupRuleLocation {
    cidrBlocks?: pulumi.Input<pulumi.Input<string>[]>;
    ipv6CidrBlocks?: pulumi.Input<pulumi.Input<string>[]>;
    sourceSecurityGroupId?: pulumi.Input<string>;
}
Copy code
awsx.ec2.SecurityGroupRule.ingress(
  'instance-sg',
  InstanceSg,
  InstanceSg.id, // Type 'Output ' has no properties in common with type 'SecurityGroupRuleLocation'.
  new awsx.ec2.TcpPorts(8080),
)
s

steep-toddler-94095

08/26/2021, 4:53 PM
InstanceSg.id
is an
Output<string>
which does not satisfy that interface. You need to change it to
Copy code
{sourceSecurityGroupId: InstanceSg.id}