List of usage examples for com.amazonaws.services.route53.model ResourceRecordSet withTTL
public ResourceRecordSet withTTL(Long tTL)
The resource record cache time to live (TTL), in seconds.
From source file:com.deploymentio.ec2namer.helpers.DnsRegistrar.java
License:Apache License
protected Change createName(NamerRequest req, LambdaContext context, String name) { Instance instance = instanceLookup.lookup(context, req.getInstanceId()); boolean isVpc = req.isAlwaysUsePublicName() ? false : !StringUtils.isEmpty(instance.getVpcId()); RRType recordType = isVpc ? RRType.A : RRType.CNAME; ResourceRecordSet set = new ResourceRecordSet(req.createFqdn(name) + ".", recordType); set.withTTL(60l); set.withResourceRecords(//from w w w .ja va 2s. c o m new ResourceRecord(isVpc ? instance.getPrivateIpAddress() : instance.getPublicDnsName())); return new Change(ChangeAction.UPSERT, set); }