Skip to content

Commit

Permalink
Pluralize some resource names
Browse files Browse the repository at this point in the history
I ran into some property names that should be pluralized, but weren't.
This is related to pulumi/pulumi-terraform#11.
  • Loading branch information
joeduffy committed Sep 16, 2017
1 parent 4cfbf36 commit 7f508b7
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 32 deletions.
6 changes: 3 additions & 3 deletions pack/ec2/launchConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as fabric from "@pulumi/pulumi-fabric";

export class LaunchConfiguration extends fabric.Resource {
public readonly associatePublicIpAddress?: fabric.Computed<boolean>;
public readonly ebsBlockDevice: fabric.Computed<{ deleteOnTermination?: boolean, deviceName: string, encrypted: boolean, iops: number, snapshotId: string, volumeSize: number, volumeType: string }[]>;
public readonly ebsBlockDevices: fabric.Computed<{ deleteOnTermination?: boolean, deviceName: string, encrypted: boolean, iops: number, snapshotId: string, volumeSize: number, volumeType: string }[]>;
public readonly ebsOptimized: fabric.Computed<boolean>;
public readonly enableMonitoring?: fabric.Computed<boolean>;
public readonly ephemeralBlockDevice?: fabric.Computed<{ deviceName: string, virtualName: string }[]>;
Expand All @@ -32,7 +32,7 @@ export class LaunchConfiguration extends fabric.Resource {
}
super("aws:ec2/launchConfiguration:LaunchConfiguration", urnName, {
"associatePublicIpAddress": args.associatePublicIpAddress,
"ebsBlockDevice": args.ebsBlockDevice,
"ebsBlockDevices": args.ebsBlockDevices,
"ebsOptimized": args.ebsOptimized,
"enableMonitoring": args.enableMonitoring,
"ephemeralBlockDevice": args.ephemeralBlockDevice,
Expand All @@ -55,7 +55,7 @@ export class LaunchConfiguration extends fabric.Resource {

export interface LaunchConfigurationArgs {
readonly associatePublicIpAddress?: fabric.MaybeComputed<boolean>;
readonly ebsBlockDevice?: fabric.MaybeComputed<{ deleteOnTermination?: fabric.MaybeComputed<boolean>, deviceName: fabric.MaybeComputed<string>, encrypted?: fabric.MaybeComputed<boolean>, iops?: fabric.MaybeComputed<number>, snapshotId?: fabric.MaybeComputed<string>, volumeSize?: fabric.MaybeComputed<number>, volumeType?: fabric.MaybeComputed<string> }>[];
readonly ebsBlockDevices?: fabric.MaybeComputed<{ deleteOnTermination?: fabric.MaybeComputed<boolean>, deviceName: fabric.MaybeComputed<string>, encrypted?: fabric.MaybeComputed<boolean>, iops?: fabric.MaybeComputed<number>, snapshotId?: fabric.MaybeComputed<string>, volumeSize?: fabric.MaybeComputed<number>, volumeType?: fabric.MaybeComputed<string> }>[];
readonly ebsOptimized?: fabric.MaybeComputed<boolean>;
readonly enableMonitoring?: fabric.MaybeComputed<boolean>;
readonly ephemeralBlockDevice?: fabric.MaybeComputed<{ deviceName: fabric.MaybeComputed<string>, virtualName: fabric.MaybeComputed<string> }>[];
Expand Down
6 changes: 3 additions & 3 deletions pack/ecs/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class Service extends fabric.Resource {
public readonly deploymentMinimumHealthyPercent?: fabric.Computed<number>;
public readonly desiredCount?: fabric.Computed<number>;
public readonly iamRole?: fabric.Computed<string>;
public readonly loadBalancer?: fabric.Computed<{ containerName: string, containerPort: number, elbName?: string, targetGroupArn?: string }[]>;
public readonly loadBalancers?: fabric.Computed<{ containerName: string, containerPort: number, elbName?: string, targetGroupArn?: string }[]>;
public readonly name: fabric.Computed<string>;
public readonly placementConstraints?: fabric.Computed<{ expression?: string, type: string }[]>;
public readonly placementStrategy?: fabric.Computed<{ field?: string, type: string }[]>;
Expand All @@ -25,7 +25,7 @@ export class Service extends fabric.Resource {
"deploymentMinimumHealthyPercent": args.deploymentMinimumHealthyPercent,
"desiredCount": args.desiredCount,
"iamRole": args.iamRole,
"loadBalancer": args.loadBalancer,
"loadBalancers": args.loadBalancers,
"name": args.name,
"placementConstraints": args.placementConstraints,
"placementStrategy": args.placementStrategy,
Expand All @@ -40,7 +40,7 @@ export interface ServiceArgs {
readonly deploymentMinimumHealthyPercent?: fabric.MaybeComputed<number>;
readonly desiredCount?: fabric.MaybeComputed<number>;
readonly iamRole?: fabric.MaybeComputed<string>;
readonly loadBalancer?: fabric.MaybeComputed<{ containerName: fabric.MaybeComputed<string>, containerPort: fabric.MaybeComputed<number>, elbName?: fabric.MaybeComputed<string>, targetGroupArn?: fabric.MaybeComputed<string> }>[];
readonly loadBalancers?: fabric.MaybeComputed<{ containerName: fabric.MaybeComputed<string>, containerPort: fabric.MaybeComputed<number>, elbName?: fabric.MaybeComputed<string>, targetGroupArn?: fabric.MaybeComputed<string> }>[];
readonly name?: fabric.MaybeComputed<string>;
readonly placementConstraints?: fabric.MaybeComputed<{ expression?: fabric.MaybeComputed<string>, type: fabric.MaybeComputed<string> }>[];
readonly placementStrategy?: fabric.MaybeComputed<{ field?: fabric.MaybeComputed<string>, type: fabric.MaybeComputed<string> }>[];
Expand Down
10 changes: 5 additions & 5 deletions pack/elasticloadbalancingv2/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import * as fabric from "@pulumi/pulumi-fabric";
export class Listener extends fabric.Resource {
public /*out*/ readonly arn: fabric.Computed<string>;
public readonly certificateArn?: fabric.Computed<string>;
public readonly defaultAction: fabric.Computed<{ targetGroupArn: string, type: string }[]>;
public readonly defaultActions: fabric.Computed<{ targetGroupArn: string, type: string }[]>;
public readonly loadBalancerArn: fabric.Computed<string>;
public readonly port: fabric.Computed<number>;
public readonly protocol?: fabric.Computed<string>;
public readonly sslPolicy: fabric.Computed<string>;

constructor(urnName: string, args: ListenerArgs, dependsOn?: fabric.Resource[]) {
if (args.defaultAction === undefined) {
throw new Error("Missing required property 'defaultAction'");
if (args.defaultActions === undefined) {
throw new Error("Missing required property 'defaultActions'");
}
if (args.loadBalancerArn === undefined) {
throw new Error("Missing required property 'loadBalancerArn'");
Expand All @@ -24,7 +24,7 @@ export class Listener extends fabric.Resource {
}
super("aws:elasticloadbalancingv2/listener:Listener", urnName, {
"certificateArn": args.certificateArn,
"defaultAction": args.defaultAction,
"defaultActions": args.defaultActions,
"loadBalancerArn": args.loadBalancerArn,
"port": args.port,
"protocol": args.protocol,
Expand All @@ -36,7 +36,7 @@ export class Listener extends fabric.Resource {

export interface ListenerArgs {
readonly certificateArn?: fabric.MaybeComputed<string>;
readonly defaultAction: fabric.MaybeComputed<{ targetGroupArn: fabric.MaybeComputed<string>, type: fabric.MaybeComputed<string> }>[];
readonly defaultActions: fabric.MaybeComputed<{ targetGroupArn: fabric.MaybeComputed<string>, type: fabric.MaybeComputed<string> }>[];
readonly loadBalancerArn: fabric.MaybeComputed<string>;
readonly port: fabric.MaybeComputed<number>;
readonly protocol?: fabric.MaybeComputed<string>;
Expand Down
20 changes: 10 additions & 10 deletions pack/elasticloadbalancingv2/listenerRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
import * as fabric from "@pulumi/pulumi-fabric";

export class ListenerRule extends fabric.Resource {
public readonly action: fabric.Computed<{ targetGroupArn: string, type: string }[]>;
public readonly actions: fabric.Computed<{ targetGroupArn: string, type: string }[]>;
public /*out*/ readonly arn: fabric.Computed<string>;
public readonly condition: fabric.Computed<{ field?: string, values?: string[] }[]>;
public readonly conditions: fabric.Computed<{ field?: string, values?: string[] }[]>;
public readonly listenerArn: fabric.Computed<string>;
public readonly priority: fabric.Computed<number>;

constructor(urnName: string, args: ListenerRuleArgs, dependsOn?: fabric.Resource[]) {
if (args.action === undefined) {
throw new Error("Missing required property 'action'");
if (args.actions === undefined) {
throw new Error("Missing required property 'actions'");
}
if (args.condition === undefined) {
throw new Error("Missing required property 'condition'");
if (args.conditions === undefined) {
throw new Error("Missing required property 'conditions'");
}
if (args.listenerArn === undefined) {
throw new Error("Missing required property 'listenerArn'");
Expand All @@ -24,8 +24,8 @@ export class ListenerRule extends fabric.Resource {
throw new Error("Missing required property 'priority'");
}
super("aws:elasticloadbalancingv2/listenerRule:ListenerRule", urnName, {
"action": args.action,
"condition": args.condition,
"actions": args.actions,
"conditions": args.conditions,
"listenerArn": args.listenerArn,
"priority": args.priority,
"arn": undefined,
Expand All @@ -34,8 +34,8 @@ export class ListenerRule extends fabric.Resource {
}

export interface ListenerRuleArgs {
readonly action: fabric.MaybeComputed<{ targetGroupArn: fabric.MaybeComputed<string>, type: fabric.MaybeComputed<string> }>[];
readonly condition: fabric.MaybeComputed<{ field?: fabric.MaybeComputed<string>, values?: fabric.MaybeComputed<fabric.MaybeComputed<string>>[] }>[];
readonly actions: fabric.MaybeComputed<{ targetGroupArn: fabric.MaybeComputed<string>, type: fabric.MaybeComputed<string> }>[];
readonly conditions: fabric.MaybeComputed<{ field?: fabric.MaybeComputed<string>, values?: fabric.MaybeComputed<fabric.MaybeComputed<string>>[] }>[];
readonly listenerArn: fabric.MaybeComputed<string>;
readonly priority: fabric.MaybeComputed<number>;
}
Expand Down
6 changes: 3 additions & 3 deletions pack/elasticloadbalancingv2/targetGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class TargetGroup extends fabric.Resource {
public /*out*/ readonly arn: fabric.Computed<string>;
public /*out*/ readonly arnSuffix: fabric.Computed<string>;
public readonly deregistrationDelay?: fabric.Computed<number>;
public readonly healthCheck: fabric.Computed<{ healthyThreshold?: number, interval?: number, matcher?: string, path?: string, port?: string, protocol?: string, timeout?: number, unhealthyThreshold?: number }[]>;
public readonly healthChecks: fabric.Computed<{ healthyThreshold?: number, interval?: number, matcher?: string, path?: string, port?: string, protocol?: string, timeout?: number, unhealthyThreshold?: number }[]>;
public readonly name: fabric.Computed<string>;
public readonly namePrefix?: fabric.Computed<string>;
public readonly port: fabric.Computed<number>;
Expand All @@ -28,7 +28,7 @@ export class TargetGroup extends fabric.Resource {
}
super("aws:elasticloadbalancingv2/targetGroup:TargetGroup", urnName, {
"deregistrationDelay": args.deregistrationDelay,
"healthCheck": args.healthCheck,
"healthChecks": args.healthChecks,
"name": args.name,
"namePrefix": args.namePrefix,
"port": args.port,
Expand All @@ -44,7 +44,7 @@ export class TargetGroup extends fabric.Resource {

export interface TargetGroupArgs {
readonly deregistrationDelay?: fabric.MaybeComputed<number>;
readonly healthCheck?: fabric.MaybeComputed<{ healthyThreshold?: fabric.MaybeComputed<number>, interval?: fabric.MaybeComputed<number>, matcher?: fabric.MaybeComputed<string>, path?: fabric.MaybeComputed<string>, port?: fabric.MaybeComputed<string>, protocol?: fabric.MaybeComputed<string>, timeout?: fabric.MaybeComputed<number>, unhealthyThreshold?: fabric.MaybeComputed<number> }>[];
readonly healthChecks?: fabric.MaybeComputed<{ healthyThreshold?: fabric.MaybeComputed<number>, interval?: fabric.MaybeComputed<number>, matcher?: fabric.MaybeComputed<string>, path?: fabric.MaybeComputed<string>, port?: fabric.MaybeComputed<string>, protocol?: fabric.MaybeComputed<string>, timeout?: fabric.MaybeComputed<number>, unhealthyThreshold?: fabric.MaybeComputed<number> }>[];
readonly name?: fabric.MaybeComputed<string>;
readonly namePrefix?: fabric.MaybeComputed<string>;
readonly port: fabric.MaybeComputed<number>;
Expand Down
42 changes: 34 additions & 8 deletions resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,13 @@ func Provider() tfbridge.ProviderInfo {
Tok: awsrestok(iotMod, "Policy"),
IDFields: []string{"name"},
},
"aws_key_pair": {Tok: awsrestok(ec2Mod, "KeyPair")},
"aws_launch_configuration": {Tok: awsrestok(ec2Mod, "LaunchConfiguration")},
"aws_key_pair": {Tok: awsrestok(ec2Mod, "KeyPair")},
"aws_launch_configuration": {
Tok: awsrestok(ec2Mod, "LaunchConfiguration"),
Fields: map[string]*tfbridge.SchemaInfo{
"ebs_block_device": {Name: "ebsBlockDevices"},
},
},
"aws_main_route_table_association": {Tok: awsrestok(ec2Mod, "MainRouteTableAssociation")},
"aws_nat_gateway": {Tok: awsrestok(ec2Mod, "NatGateway")},
"aws_network_acl": {Tok: awsrestok(ec2Mod, "NetworkAcl")},
Expand Down Expand Up @@ -432,8 +437,13 @@ func Provider() tfbridge.ProviderInfo {
"aws_ecr_repository": {Tok: awsrestok(ecrMod, "Repository")},
"aws_ecr_repository_policy": {Tok: awsrestok(ecrMod, "RepositoryPolicy")},
// Elastic Container Service
"aws_ecs_cluster": {Tok: awsrestok(ecsMod, "Cluster")},
"aws_ecs_service": {Tok: awsrestok(ecsMod, "Service")},
"aws_ecs_cluster": {Tok: awsrestok(ecsMod, "Cluster")},
"aws_ecs_service": {
Tok: awsrestok(ecsMod, "Service"),
Fields: map[string]*tfbridge.SchemaInfo{
"load_balancer": {Name: "loadBalancers"},
},
},
"aws_ecs_task_definition": {Tok: awsrestok(ecsMod, "TaskDefinition")},
// Elastic File System
"aws_efs_file_system": {Tok: awsrestok(efsMod, "FileSystem")},
Expand All @@ -449,10 +459,26 @@ func Provider() tfbridge.ProviderInfo {
// Elastic Load Balancing (V2: Application)
"aws_app_cookie_stickiness_policy": {Tok: awsrestok(elbMod, "CookieStickinessPolicy")},
"aws_alb": {Tok: awsrestok(elbv2Mod, "LoadBalancer")},
"aws_alb_listener": {Tok: awsrestok(elbv2Mod, "Listener")},
"aws_alb_listener_rule": {Tok: awsrestok(elbv2Mod, "ListenerRule")},
"aws_alb_target_group": {Tok: awsrestok(elbv2Mod, "TargetGroup")},
"aws_alb_target_group_attachment": {Tok: awsrestok(elbv2Mod, "TargetGroupAttachment")},
"aws_alb_listener": {
Tok: awsrestok(elbv2Mod, "Listener"),
Fields: map[string]*tfbridge.SchemaInfo{
"default_action": {Name: "defaultActions"},
},
},
"aws_alb_listener_rule": {
Tok: awsrestok(elbv2Mod, "ListenerRule"),
Fields: map[string]*tfbridge.SchemaInfo{
"action": {Name: "actions"},
"condition": {Name: "conditions"},
},
},
"aws_alb_target_group": {
Tok: awsrestok(elbv2Mod, "TargetGroup"),
Fields: map[string]*tfbridge.SchemaInfo{
"health_check": {Name: "healthChecks"},
},
},
"aws_alb_target_group_attachment": {Tok: awsrestok(elbv2Mod, "TargetGroupAttachment")},
// Elastic Search
"aws_elasticsearch_domain": {Tok: awsrestok(elasticsearchMod, "Domain")},
"aws_elasticsearch_domain_policy": {Tok: awsrestok(elasticsearchMod, "DomainPolicy")},
Expand Down

0 comments on commit 7f508b7

Please sign in to comment.