Error: Apply not allowed for workspaces with a VCS connection
Run Code Online (Sandbox Code Playgroud)
我在尝试通过 Github Actions 应用 terraform 计划时收到此错误。
Github Action(地形应用)
- name: Terraform Apply Dev
id: apply_dev
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: TF_WORKSPACE=dev terraform apply -auto-approve deployment/
Run Code Online (Sandbox Code Playgroud)
Terraform 工作区
该工作区是在 Terraform Cloud 上创建的,Version control workflow
称为app-infra-dev
地形后端
# The configuration for the `remote` backend.
terraform {
backend "remote" {
hostname = "app.terraform.io"
organization = "my-org-name"
workspaces {
prefix = "app-infra-"
}
}
}
Run Code Online (Sandbox Code Playgroud)
因此,因为我调用了我的工作区app-infra-dev
,所以我在后端文件中的工作区前缀是在我的 …
我已经建立了一个React表,像这样:
const Table = ({data}) => {
return (
<table className="table table-bordered">
<thead>
<tr>
<th>Qty</th>
<th>Description</th>
<th>Price (£)</th>
</tr>
</thead>
<tbody>
{data.map((row) => {
return (
<tr>
<td><input type='number' className='form-control' step='1' min="1" value={row[0]}/></td>
<td><input type='text' className='form-control' value={row[1]}/></td>
<td><input type='text' className='form-control' placeholder='6.00' value={row[2]}/></td>
</tr>
);
})}
</tbody>
</table>
);
};
Table.propTypes = {
data: React.PropTypes.array.isRequired
};
export default Table;
Run Code Online (Sandbox Code Playgroud)
在类中,我正在使用此组件,我正在将数据作为参数传递(最初为空):
materials: [[],[],[],[],[],[],[],[],[],[]] //Initialise with 10 empty rows
<Table data={materials} />
Run Code Online (Sandbox Code Playgroud)
这将建立一个包含10个空行的表。现在唯一的问题是,当我在表中输入数据时,映射的数据数组不会随输入的数据更新。
我认为我需要的是一些事件,可以在其中输入已输入内容的快照来更新数据,但是我不确定如何执行此操作。任何帮助将不胜感激。