public IamInstanceProfileSpecification toIamInstanceProfileSpecification() { final IamInstanceProfileSpecification spec = new IamInstanceProfileSpecification(); spec.setName(name); spec.setArn(arn); return spec; }
req.setIamInstanceProfile(new IamInstanceProfileSpecification().withArn(config.getProperty("worker-iam-role")));
/** * Retrieves an IAM profile spec for a given IAM role. Note that the role * needs to already exist. The IAM profile is created if it does not already exist. * * @param iamRole name of the IAM role to be retrieved in profile form * @return IAM instance profile or null if iamRole is null */ private IamInstanceProfileSpecification getIamProfileSpec(String iamRole) { if(null != iamRole) { InstanceProfile instanceProfile; try { GetInstanceProfileResult getProfileResult = iamClient.getInstanceProfile(new GetInstanceProfileRequest() .withInstanceProfileName(iamRole)); instanceProfile = getProfileResult.getInstanceProfile(); } catch (NoSuchEntityException e) { // No existing entity, create one CreateInstanceProfileResult createProfileResult = iamClient.createInstanceProfile(new CreateInstanceProfileRequest() .withInstanceProfileName( iamRole)); instanceProfile = createProfileResult.getInstanceProfile(); } if (null != instanceProfile) { return new IamInstanceProfileSpecification() .withName(instanceProfile.getInstanceProfileName()); } } return null; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ReplaceIamInstanceProfileAssociationRequest == false) return false; ReplaceIamInstanceProfileAssociationRequest other = (ReplaceIamInstanceProfileAssociationRequest) obj; if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == null) return false; if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == false) return false; if (other.getAssociationId() == null ^ this.getAssociationId() == null) return false; if (other.getAssociationId() != null && other.getAssociationId().equals(this.getAssociationId()) == false) return false; return true; }
/** * <p> * The Amazon Resource Name (ARN) of the instance profile. * </p> * * @param arn * The Amazon Resource Name (ARN) of the instance profile. * @return Returns a reference to this object so that method calls can be chained together. */ public IamInstanceProfileSpecification withArn(String arn) { setArn(arn); return this; }
/** * <p> * The name of the instance profile. * </p> * * @param name * The name of the instance profile. * @return Returns a reference to this object so that method calls can be chained together. */ public IamInstanceProfileSpecification withName(String name) { setName(name); return this; }
.withInstanceType(instanceType) .withSubnetId(subnetId) .withIamInstanceProfile(new IamInstanceProfileSpecification().withName(iamInstanceProfileName)); if (Strings.isNullOrEmpty(this.userData) == false) { request.setUserData(new String(Base64.getEncoder()
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AssociateIamInstanceProfileRequest == false) return false; AssociateIamInstanceProfileRequest other = (AssociateIamInstanceProfileRequest) obj; if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == null) return false; if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == false) return false; if (other.getInstanceId() == null ^ this.getInstanceId() == null) return false; if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false) return false; return true; }
/** * <p> * The Amazon Resource Name (ARN) of the instance profile. * </p> * * @param arn * The Amazon Resource Name (ARN) of the instance profile. * @return Returns a reference to this object so that method calls can be chained together. */ public IamInstanceProfileSpecification withArn(String arn) { setArn(arn); return this; }
/** * <p> * The name of the instance profile. * </p> * * @param name * The name of the instance profile. * @return Returns a reference to this object so that method calls can be chained together. */ public IamInstanceProfileSpecification withName(String name) { setName(name); return this; }
public IamInstanceProfileSpecification unmarshall(StaxUnmarshallerContext context) throws Exception { IamInstanceProfileSpecification iamInstanceProfileSpecification = new IamInstanceProfileSpecification(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return iamInstanceProfileSpecification; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("arn", targetDepth)) { iamInstanceProfileSpecification.setArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("name", targetDepth)) { iamInstanceProfileSpecification.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return iamInstanceProfileSpecification; } } } }
launchSpecification.setIamInstanceProfile(new IamInstanceProfileSpecification().withArn(getIamInstanceProfile()));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof IamInstanceProfileSpecification == false) return false; IamInstanceProfileSpecification other = (IamInstanceProfileSpecification) obj; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; return true; }
if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == null) return false; if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == false) return false; if (other.getImageId() == null ^ this.getImageId() == null)
public IamInstanceProfileSpecification unmarshall(StaxUnmarshallerContext context) throws Exception { IamInstanceProfileSpecification iamInstanceProfileSpecification = new IamInstanceProfileSpecification(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) return iamInstanceProfileSpecification; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("arn", targetDepth)) { iamInstanceProfileSpecification.setArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("name", targetDepth)) { iamInstanceProfileSpecification.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { return iamInstanceProfileSpecification; } } } }
riRequest.setIamInstanceProfile(new IamInstanceProfileSpecification().withArn(getIamInstanceProfile()));
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getName() != null) sb.append("Name: ").append(getName()); sb.append("}"); return sb.toString(); }
if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == null) return false; if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == false) return false; if (other.getImageId() == null ^ this.getImageId() == null)
public IamInstanceProfileSpecification toIamInstanceProfileSpecification() { final IamInstanceProfileSpecification spec = new IamInstanceProfileSpecification(); spec.setName(name); spec.setArn(arn); return spec; }