Permalink
Browse files

add iamInstanceProfile params

  • Loading branch information...
Genki Sugawara
Genki Sugawara committed Dec 18, 2012
1 parent c568497 commit 9eb6cb2ff04ab2f54f873034be1179eb17baf776
@@ -205,6 +205,8 @@ var ec2ui_AMIsTreeView = {
retVal.subnetId,
retVal.ipAddress,
retVal.securityGroupIds,
+ retVal.iamInstanceProfileArn,
+ retVal.iamInstanceProfileName,
this.newInstanceCallback);
}
},
@@ -13,7 +13,7 @@ var ec2_httpclient = {
USER_AGENT : "Elasticfox/1.7-000116",
- API_VERSION : "2012-10-01",
+ API_VERSION : "2012-12-01",
ELB_API_VERSION : "2011-11-15",
VPN_CONFIG_PATH : "http://ec2-downloads.s3.amazonaws.com/",
@@ -945,7 +945,10 @@ var ec2ui_controller = {
var rdt = getNodeValueByName(instanceItems[j], "rootDeviceType");
- list.push(new Instance(resId,
+ var iamInstanceProfile = instanceItems[j].getElementsByTagName("iamInstanceProfile")[0];
+ var iamInstanceProfileArn = iamInstanceProfile ? getNodeValueByName(iamInstanceProfile, "arn") : '';
+
+ list.push(new Instance(resId,
ownerId,
groups,
instanceId,
@@ -966,13 +969,14 @@ var ec2ui_controller = {
null,
vpcId,
subnetId,
- rdt));
+ rdt,
+ iamInstanceProfileArn));
}
return list;
},
- runInstances : function (imageId, kernelId, ramdiskId, minCount, maxCount, keyName, securityGroups, userData, properties, ephemeral0, ephemeral1, ephemeral2, ephemeral3, instanceType, placement, subnetId, ipAddress, securityGroupIds, callback) {
+ runInstances : function (imageId, kernelId, ramdiskId, minCount, maxCount, keyName, securityGroups, userData, properties, ephemeral0, ephemeral1, ephemeral2, ephemeral3, instanceType, placement, subnetId, ipAddress, securityGroupIds, iamInstanceProfileArn, iamInstanceProfileName, callback) {
var params = []
params.push(["ImageId", imageId]);
if (kernelId != null && kernelId != "") {
@@ -1040,6 +1044,14 @@ var ec2ui_controller = {
}
}
+ if (iamInstanceProfileArn) {
+ params.push(["IamInstanceProfile.Arn", iamInstanceProfileArn]);
+ }
+
+ if (iamInstanceProfileName) {
+ params.push(["IamInstanceProfile.Name", iamInstanceProfileName]);
+ }
+
ec2_httpclient.queryEC2("RunInstances", params, this, true, "onCompleteRunInstances", callback);
},
@@ -86,6 +86,10 @@
<label control="ec2ui.instance.eip" value="Elastic IP:" />
<textbox id="ec2ui.instance.eip" size="30" readonly="true" />
</row>
+ <row>
+ <label control="ec2ui.instance.iamInstanceProfileArn" value="IAM ARN:" />
+ <textbox id="ec2ui.instance.iamInstanceProfileArn" size="30" readonly="true" />
+ </row>
<row>
<label control="ec2ui.instance.volumelist" value="EBS Volumes:" />
<listbox id="ec2ui.instance.volumelist" seltype="single" rows="4" flex="1" />
@@ -145,6 +145,25 @@
</groupbox>
</vbox>
</hbox>
+ <groupbox flex="1" id="ec2ui.newinstances.iam.box">
+ <caption label="IAM Instance Profile" />
+ <grid flex="1">
+ <columns>
+ <column width="50" />
+ <column flex="1" />
+ </columns>
+ <rows>
+ <row>
+ <label control="ec2ui.newinstances.iam.arn" value="ARN:" />
+ <textbox id="ec2ui.newinstances.iam.arn" />
+ </row>
+ <row>
+ <label control="ec2ui.newinstances.iam.name" value="Name:" />
+ <textbox id="ec2ui.newinstances.iam.name" />
+ </row>
+ </rows>
+ </grid>
+ </groupbox>
<groupbox flex="1" id="ec2ui.newinstances.secgroups.box">
<caption label="&ec2ui.captions.images.launchsecgroups.label;" />
<grid flex="1">
@@ -30,6 +30,7 @@ var ec2_InstanceDetails = {
document.getElementById("ec2ui.instance.vpcid").value = instance.vpcId;
document.getElementById("ec2ui.instance.subnetid").value = instance.subnetId;
document.getElementById("ec2ui.instance.tag").value = instance.tag || "";
+ document.getElementById("ec2ui.instance.iamInstanceProfileArn").value = instance.iamInstanceProfileArn;
var secGroups = document.getElementById("ec2ui.instance.securitygrouplist");
for(var i in instance.groupList) {
@@ -235,6 +235,9 @@
<treecol id="instance.comment" label="Comment"
flex="2" persist="width ordinal hidden sortDirection" />
<splitter class="tree-splitter" />
+ <treecol id="instance.iamInstanceProfileArn" label="IAM Instance Profile ARN"
+ flex="2" persist="width ordinal hidden sortDirection" />
+ <splitter class="tree-splitter" />
</treecols>
<treechildren context="ec2ui.instances.contextmenu" />
</tree>
@@ -23,7 +23,8 @@ var ec2ui_InstancesTreeView = {
'instance.vpcId',
'instance.subnetId',
'instance.rootDeviceType',
- 'instance.comment'
+ 'instance.comment',
+ 'instance.iamInstanceProfileArn'
],
treeBox: null,
selection: null,
@@ -935,6 +936,8 @@ var ec2ui_InstancesTreeView = {
instance.subnetId,
null,
null,
+ null,
+ null,
wrap);
},
@@ -92,7 +92,7 @@ function Volume(id, size, snapshotId, zone, status, createTime, instanceId, devi
function Instance(resId, ownerId, groupList, instanceId, imageId, kernelId,
ramdiskId, state, publicDnsName, privateDnsName, privateIpAddress, keyName, reason,
- amiLaunchIdx, instanceType, launchTime, placement, platform, tag, vpcId, subnetId, rootDeviceType) {
+ amiLaunchIdx, instanceType, launchTime, placement, platform, tag, vpcId, subnetId, rootDeviceType, iamInstanceProfileArn) {
this.resId = resId;
this.ownerId = ownerId;
this.groupList = groupList;
@@ -124,6 +124,7 @@ function Instance(resId, ownerId, groupList, instanceId, imageId, kernelId,
}
this.rootDeviceType = rootDeviceType;
+ this.iamInstanceProfileArn = iamInstanceProfileArn;
}
function KeyPair(name, fingerprint) {
@@ -79,6 +79,10 @@ var ec2_InstanceLauncher = {
this.retVal.ephemeral1 = document.getElementById("ec2ui.newinstances.ephemeral1").value;
this.retVal.ephemeral2 = document.getElementById("ec2ui.newinstances.ephemeral2").value;
this.retVal.ephemeral3 = document.getElementById("ec2ui.newinstances.ephemeral3").value;
+
+ this.retVal.iamInstanceProfileArn = document.getElementById("ec2ui.newinstances.iam.arn").value.trim();
+ this.retVal.iamInstanceProfileName = document.getElementById("ec2ui.newinstances.iam.name").value.trim();
+
this.retVal.ok = true;
return true;

0 comments on commit 9eb6cb2

Please sign in to comment.