cfdsl.ec2.property.SecurityGroupIngressRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cfdsl Show documentation
Show all versions of cfdsl Show documentation
Java DSL for Amazon CloudFormation templates
The newest version!
package cfdsl.ec2.property;
import cfdsl.ec2.SecurityGroup;
import cfdsl.fn.Derefable;
import cfdsl.fn.StringLike;
public final class SecurityGroupIngressRule extends Rule {
private SecurityGroupIngressRule(Builder b) {
super(b);
}
public static Builder of(int fromPort, int toPort, Protocol protocol) {
return new Builder(fromPort, toPort, protocol);
}
public static final class Builder extends Rule.Builder {
public Builder(int fromPort, int toPort, Protocol protocol) {
super(fromPort, toPort, protocol);
}
public Builder cidrIp(String cidrIp) {
addProperty("CidrIp", cidrIp);
return this;
}
public Builder cidrIp(StringLike cidrIp) {
addProperty("CidrIp", cidrIp);
return this;
}
public Builder cidrIp(Derefable cidrIp) {
return cidrIp(cidrIp.ref());
}
public Builder sourceSecurityGroupId(SecurityGroup source) {
addProperty("SourceSecurityGroupId", source);
return this;
}
public Builder sourceSecurityGroup(SecurityGroup source) {
addProperty("SourceSecurityGroupName", source);
return this;
}
public Builder sourceSecurityGroupOwnerId(StringLike sourceSecurityGroupOwnerId) {
addProperty("SourceSecurityGroupOwnerId", sourceSecurityGroupOwnerId);
return this;
}
@Override
public SecurityGroupIngressRule build() {
return new SecurityGroupIngressRule(this);
}
}
}